Peter Bergen is CNN's national security analyst, a vice president at New America and a professor of practice at Arizona State University. He is writing a book for Penguin Random House about the national security decision-making of the Trump administration.

(CNN) In withdrawing the US from the Iran nuclear deal, President Donald Trump is taking a huge gamble. And aside from his desire to repudiate everything done by his predecessor, President Barack Obama, it's really hard to see why he is making this decision.

Let's stipulate first that the Iran nuclear deal is working surprisingly well. That's according to the congressional testimony of Trump's own secretary of defense, James Mattis, who testified in October that the Iran deal was in American national security interests.

That the deal is working is also the considered view of some of the most hawkish Israelis -- for instance, Ehud Barak, who is a former Israeli prime minister and former defense minister as well as a former chief of staff of the Israeli army.

As recently as Monday, Barak told the Daily Beast that the Iranians have "kept the letter of the agreement quite systematically... [and] all in all it delays the new starting point or countdown towards a nuclear capability."

Yukiya Amano, the head of the International Atomic Energy Agency (IAEA), which is monitoring the Iran agreement, said in March that , "The IAEA now has the world's most robust verification regime in place in Iran. We have had access to all the locations that we needed to visit... As of today, I can state that Iran is implementing its nuclear-related commitments."

So why blow up the Iran nuclear deal, given that this array of impressive, independent observers say it's working?

Trump, it seems, has become a prisoner of his own hyperbolic rhetoric, constantly repeating his mantra that the Iran deal is " the worst deal ever negotiated ."

Of course, this is nonsense. For the Obama administration it was simply the best deal on offer. Could the Obama team have pushed harder for tougher "sunset" clauses on the deal that would have pushed even further into the future the moment when Iran could resume its nuclear program? Maybe.

But that is hardly an argument for effectively walking away from the deal, which delays the Iranian nuclear weapons program from resuming for around a decade from its inception three years ago.

In the tricky art of diplomacy, a reasonably good solution is not the enemy of a perfect solution, since those are rarely on offer. To be sure, the deal didn't address the fact that Iran has a robust ballistic missile program, but the deal wasn't about the unilateral disarmament of Iran -- which Iran would be quite unlikely to agree to since its only real ally around the world is Syria! -- but rather it was to stop the Iranians from acquiring nuclear weapons with all the new, additional leverage that would give them in the region.

Also, if Iran has nuclear weapons, that is sure to spark a regional nuclear arms race in which Saudi Arabia would also try to acquire them as soon as feasible.

Three of the United States' closest allies, Britain, France and Germany, are all signatories to the Iran deal. In recent weeks leaders of these countries have all begged Trump to remain in the deal. These allies were even willing to negotiate amendments to the deal about issues such as Iran's ballistic missile program under the rubric "fix it, don't nix it," but even that wasn't sufficient for Trump.

Why? Historians will likely be debating this question for years. After all the Iran deal is quite popular with Americans, a healthy majority of whom -- 63% -- want to stay in the deal, while only 29% want to leave it, according to a new CNN poll.

Those numbers are quite similar to these who opposed President Trump's decision to withdraw from the Paris climate agreement last year: 59% opposed that decision, while 28% supported it, according to a Washington Post-ABC News poll:

Similarly, Obamacare is now favored by a majority of Americans , according to a March poll by Kaiser.

Trump is intent, it seems, on undoing the key international and domestic accomplishments of the Obama administration. The question is: does he have a "plan B" that makes any sense? Trump said he would repeal and replace Obamacare, but when it came down to it he and the Republican Party didn't have a real viable plan to do so.

Follow CNN Opinion Join us on Twitter and Facebook

The Iranians have repeatedly said they won't renegotiate the nuclear deal, which means they could restart their nuclear enrichment program. That, of course, will lead to renewed tensions with the United States, Israel and the Gulf States that the nuclear deal was designed to tamp down. And that path takes us back to the real and renewed possibility of a war in the region.

We can all hope that Trump's big bet that he will force the Iranians back to the negotiating table will pay off, but history suggests that these kinds of bets are easy to make on the campaign trail, but are much harder to pull off when you are sitting in the Oval Office.