Furthermore 1,000,000 Iranians died in the Iran-Iraq War, most of which killed by chemical weapons supplied to them by US-allies, and in Iran no-one really blames Germany or Egypt or countries like that for it, everyone sees America as the guilty one. Also the fact that WMDs were used on Iran, on it's military and on it's cities made Iran see how vunerable they were without it. That's made the regime resume a nuclear program which was started by the Shah, with American help.
Also the nuclear program and infact the whole anti-American policy of Iran is a tactic by the regime that is being used to keep the peoples minds of their very unpopulair internal politics. The political censorship, the fact that the elections in Iran are all frauds and the religious laws being enforced on a country with mostly secular people is all very unpopulair. In response the regime does a populair foreign policy and tries to, with that, keep the people's minds off the internal problems and the fact that they are a dictatorship more ruthless than the previous one.