A large segment of the Iranian political class bet their reputations on the nuclear non-proliferation deal with the US in 2015. They've all now been utterly discredited and the hardliners proven correct in all of their predictions.
They can look at Ukraine who bitterly regrets giving up their nuclear weapons, or North Korea, seemingly invulnerable despite being the most pariah of pariah states.
From the perspective of the Iranian state, it would be idiotic and irresponsible not to try to make a nuclear weapon in these conditions.
"From the perspective of the Iranian state" Well you say that but they have got a non-nuclear nuke equivalent in the form of kamikaze drones.
> North Korea, seemingly invulnerable
Because of China not because of the nukes.