The FBI is a police organisation, not a spy organisation (though catching spies is also part of their duties). So everything you said about spying is not relevant in this context.
You are right. I took the context of how they solved the issue to be part of the bigger picture of government spying though.
You have a point in that they first needed to find out what country the person of interest was in. When they found out it was Iran, it should have become the responsibility of Iranian police.
According to the article, all they have done so far is generally locate the person by installing the software. It is yet to be seen if anything else, including cooperation with Iranian authorities, would happen. So I guess arguing that would be pointless on my part.
It is possible (IANAL) that the FBI violated Iranian laws by installing spyware on someone elses computer in Iran. (They didn't have a warrant from an Iranian judge.) Would the USA be willing to deliver those responsible, or would they rather harbour criminals within their borders and make war "a necessity"?
I doubt the US would ever hand someone over for doing something under color of law or as an official state action. Wars will be fought if it happens just like those European courts who indicted Bush and Cheney knew that it was all symbolic and the governments would never arrest them when they showed up for state visits because the US would respond militarily if they did. As a matter of fact, even if the current president didn't respond that way, I'm pretty sure one will be elected on the promise to do so.
As for calling the FBI criminals, I don't think that could technically be possible unless Yahoo has a server located somewhere in Iran and he logged into that server. But it would be just as ridiculous to imagine a law banning the installation of spyware being carried into extraterritorial matters of law as Iran simply does not have that stretch of influence. I know it sounds like a matter of double standard and it is, but the influence you have determines a lot about what local laws can be enforced outside your country. And to that matter, even the US laws being enforced in other countries are largely parts of treaties like copyright and trade treaties with the exception that I know of with the computer tresspass law enforce on that kid in England. There they took the concept of the person logging into US government computers as if he traveled to the US which would be the concept carried about logging into a yahoo server outside of Iran.
So I don't think they could be called criminals and if war is a necessity, it will be because of crazy leaders in Iran more then anything else. Installing software that exposes the location of a computer used in violation of a country's laws should not be an act of war under any sane interpretation of any country's sovereignty.