There are solutions other than war to nonproliferation.
Ultimately the choice of whether or not Iran gets to build a nuclear bomb is not up to them, and they're finding that out now.
Does anyone think that situation resolved well? If we were able to go back in time, would we choose diplomacy again, knowing it would fail?
Maybe that's why NK has nukes. They US declared war on them and then threatened them with nuclear weapons to prevent North Korea from winning the war.
I don't think we've seen the resolution of that situation. We will one day, and I think the chances of it being a good outcome are pretty slim. I'm very much against Iran having nuclear weapons. I just hope we don't get dragged into a long war which will explode our national debt and potentially lead to a sovereign debt crisis.
There was never really any other option than "ask nicely to not do that", and maybe try some covert sabotage here and there. Everyone knew that and everyone knew that everyone knew.
In Iran the situation is different, because everyone knows that they don't have any such deterrent and they will lose in any real shooting war, with fairly little options to meaningfully fight back. There is a real inventive to actual pursue diplomacy for Iran which didn't exist in North-Korea.
Also the North-Korean regime and population is of quite a different nature than Iran. By and large, the North-Korean regime just wants to be left alone and is quite isolationist. This also doesn't really apply to Iran.
What makes it OK specifically for the US to do this? There is an entire international framework to deal with non proliferation. Bombing another country on the other side of the world because you can is not that.
The framework to deal with non-proliferation depends on the states involved voluntarily participating in the framework. Iran was not doing so.
There are numerous countries that enjoy paranuclear status who have had no problem not lying to the IAEA.
You cannot place blame for this outcome on anyone other than Iran, they made the move entirely of their own volition. Once you open the door for consequence, you don't get to choose how it is handed out.
Ultima ratio regum.
As for international frameworks, how should the Non-Proliferation Treaty be enforced? If a country violates it then what should the consequences be?
Iran is an objectively bad actor when it comes to nuclear weapons. They created the problem voluntarily, of their own volition. What comes after is not up to them.
Iran, by the way, broke the IAEA agreement. Fordo was built illegally, without disclosure to the IAEA.