Given that nuclear weaponry is a technology that has been around for over 70 years, Iran was going to "get the bomb" no matter what. Therefore, the only way to deal with the problem was to incentivize them not to build them. That was Obama's wise policy, and worked just fine, even though he's a no-good darky who was born in Kenya.
Now Trump broke that treaty for no better reason than to show everyone how bigly his dick is. Trumpers excuse that stupid move by claiming that Iran wasn't adhering to the treaty anyway--despite widespread verification that they were. Obama's incentives were working.
But you know what? Iran is a sovereign nation. It's entitled to arm itself with whatever weaponry it can acquire. It's not a signatory to the nuclear nonproliferation treaty. It can do as it wishes.