We can prevent them from having nukes the same way we prevented them before Trump nixed the Iran deal in his first term. If they already have nukes then this bombing doesn't do crap. They also may just get nukes from North Korea for a crap load of oil and money.
The problem with Iran obviously is they are an easy target politically and in a tactical sense. They don't have support from other Islamic nations and they actively support terrorism in Israel Whatever you feel about Trump bombing them he has an argument.
Your enemy is always the terrorist. Vietcon! Every POTUS takes the same position on Iran - they're bad and shouldn't have nukes. That's a practical, Western-centric stance I can accept. But Trump's approach mirrors Bush's methods. Same with North Korea. The strategy was always diplomatic deals to prevent their nuclear program. Both Bush and Trump scrapped those deals. Trump went further - he bombed Iran as a show of force, claiming it would deter their nuclear ambitions. This can backfire, strengthening Iran's pro-nuclear faction and accelerating their nuke weapons program.