Well they are retarded.
I could understand them not going for chemical and biological weapons like Saddam did in the Iran-Iraq war. Chemical weapons are kind of a lousy anyway and lead to needless injuries. But not having nukes when these can be used as blackmail against you is just bonkers.
The US was the only country to ever use nukes, and they did it against a country which did not have them. The Soviets realized they needed their own if they didn't want to be next. And the US military did want to use them against the PRC and the USSR in the Korean War. The only reason they didn't do it was because the Soviets also had them I bet.
You have to consider it not only from Iranian, but example Russian side as well.
From they standpoint it is like Mexico getting nuclear weapons.
Doesn't really matter the background, the current goverment and so on, the geopolitical realities will be worst for Russia if Iran doing it.
Iran know it as well.
Problem for Iran is they want to keep they full sovereignty , and nuke makes they position better with the USA, but worst in relation with they closest neighbours.