It was rational for Iran to seek a nuclear deterrent. The US had already toppled a democratically-elected Iranian government and replaced it with an autocrat. They were able to regain their independence, and since then they have been treated as a total pariah. Two neighboring countries were subsequently invaded by the US simultaneously, after the US had declared Iran to be part of the “Axis of Evil.” They could also see that the US helped to overthrow the government of Libya after Libya had given up its nuclear ambitions and become a “good citizen” in the “international community.” It would be insane for a country in that position not to seek the ultimate weapons trump card to prevent an invasion, because an invasion is literally the worst thing that can happen to a country.
Iran is not going to commit national suicide to destroy Israel. Everyone knows Israel has a nuclear deterrent. The very fact that Iran was seeking a nuclear deterrent shows them to be rational actors, and so we have to conclude that they would also be rationally deterred by a nuclear deterrent.
Negotiating an end to the nuclear program was also rational. Creating a nuclear bomb takes a long time and is difficult to hide. It was becoming increasingly clear that Iran could not get across the nuclear finish line before their very efforts to deter a future invasion directly caused a present invasion. Hence, quite rationally, they sat down to negotiate with the most reasonable US president they were likely to get. It’s also in their interest to quite unambiguously comply with the agreement, because again, they are rational people who care about their country and don’t want to see it overrun and destroyed.
It is legitimate for a country to seek to influence events in its own region. People act as though Iranian influence in the Middle East is some nefarious and illegitimate agenda all rational people should oppose. In reality, Iran is in the Middle East. It is actually physically located there. It would be ridiculous for it not to seek to influence events that directly impinge upon it in physically contiguous countries. What’s more, Iran is a relatively rich and powerful country with a long history of taking a leadership role in what is, just to review, its own part of the world.
Colonialism is a terrible historical evil. We in the West are inclined to view the 20th Century as the story of overcoming the two great evils of Nazism and Communism, but everyone else would add a third item to that list: colonialism. Resentment toward colonialism is especially great in the Middle East given that the US continually meddles in their affairs, usually in hugely destructive ways, and given that the Middle East includes the most recently-established settler colony, which is itself backed up by the meddling imperial power. We’re always on the lookout for the next Hitler, but in the Middle East, they don’t have to be vigilant against one of the great 20th century evils because it is constantly ongoing. And the US is responsible for maintaining that situation!