Iran has been defeated, but its problems are not over yet. In real life there's no referee to stop your opponent from kicking you when you're down. Once you lose your leverage, you don't even have surrender to negotiate.
Asian countries like China, India, Pakistan and North Korea were willing to eat grass to have a weapon and just sprinted towards the goal with no hesitation. Every one was under sanctions until the west gave up. It really does take that kind of national willpower. The reason was precisely that if they did not sprint towards a weapon, this sort of shit will happen.
It is use it or lose it. Once you start, you can't stop or go back. Not obeying that fundamental principle is what got Iran to this.