All public infrastructure benefits the public but the role of our governance is to correctly prioritize. $100 billion spent on nuclear power plants is $100 billion being withheld from other critical social services.
Now in Iran, the intention was to repeat Venezuela and effect regime change in a hostile country, bolstering America's military status.
Whether these wars have the effect they intend is beside the point; you're asking why they were fought, not whether they resulted in "Mission Accomplished".
What? No it isn't.
There are many places the government could use to appropriate funds, not just social services. The military, for example. Other subsidies. Tax credits. Simply increasing the debt.