There’s a saying among lawyers: Don’t take a case to the Supreme Court unless you’re sure you’ll win. Diplomats follow a similar rule: Don’t call a large international summit unless it promotes your agenda. By that measure, the 60-nation summit in Warsaw, Poland, this week has been a disaster—another sign of the shallow thinking and clueless incompetence that has marked U.S. foreign policy since Donald Trump entered the White House.

The two-day event, co-sponsored by the U.S. and Polish governments, was originally intended to be a conference of the anti-Iran coalition. But when most of the European nations bowed out, the billing was changed to address Middle Eastern issues in general. Few were fooled; most Europeans, to the extent they attended at all, sent lower-level diplomats rather than heads of state or foreign ministers—a clear signal that they assumed no important decisions or remarks would be made.

Secretary of State Mike Pompeo told the delegates that “regime change” was not U.S. policy toward Iran. But his assurances were drowned out by the appearance of Rudy Giuliani bellowing the contrary to a crowd of activists outside the meeting hall. (Giuliani stressed that he was representing Mujahedeen-e-Khalq, an anti-Iran militia, for which he has long lobbied, but he is, of course, also Trump’s personal lawyer, so if the administration were serious about messaging, he could have been blocked from attending.)

Then there was the video that national security adviser John Bolton released on Monday, in which he said, as if addressing Iranian leaders on the 40th anniversary of their revolution, “I don’t think you’ll have many more anniversaries to enjoy.”

If you’re wondering why much of the world views the United States as petty, arrogant, and spiteful, this can stand as Exhibit A.

The big rift over all this is that the other signatories to the Iran nuclear deal—which Trump abrogated last year—are still trying to make the accord work. These include Britain, France, Germany, and the European Union, as well as Russia and China. The deal, signed in 2015, required Iran to dismantle its nuclear program and open its facilities to outside inspectors; in exchange, the other powers would lift economic sanctions. Since those sanctions had been imposed as a penalty for Iran’s illegal nuclear activities, it seemed like a fair and reasonable trade. When Trump withdrew from the deal, he reimposed sanctions—and threatened to punish other countries that didn’t follow suit.

The EU is now trying to set up a financial mechanism that will allow countries to do business with Iran in some currency other than dollars. Vice President Mike Pence denounced this effort in Warsaw, calling it “an ill-advised step that will only strengthen Iran, weaken the EU, and create still more distance between Europe and the United States.”

It was an absurd pronouncement, since Trump is the one responsible for this distance. It was Trump who abrogated a perfectly functioning deal, enshrined in a U.N. resolution, for no reason at all—except that he doesn’t like Iran, doesn’t like deals that he didn’t make, and especially doesn’t like deals made by Barack Obama. And then Trump further insisted that all the other nations on the planet should abide by his prejudices, threatening to punish them financially if they didn’t. If you’re wondering why much of the world—allies and adversaries alike—views the United States as petty, arrogant, and spiteful, this can stand as Exhibit A.

The Poles agreed to set up the tent for this circus because they desperately want a permanent U.S. military base in their country and are doing all they can to appease the American president, who doesn’t care much for NATO commitments, even offering to name the base “Fort Trump.” Even so, Poland’s consul general in New York, when asked on Tuesday whether Iran posed a threat to his country, skirted the question, saying, “Poland has never said Iran is a threat to Poland. Poland is engaged in a lot of multilateral efforts to bring about stability and peace in the Middle East and the world.”

Then, at the Warsaw conference on Thursday, Poland’s foreign minister, Jacek Czaputowicz, said he was “concerned about the possible results of Iran’s nuclear program as well as the unconstructive role of the country in the region.” His statement was still ambiguous (“possible results”?) but seemed sufficiently anti-Iranian to get back in Pence and Pompeo’s good graces.

The thing is, the American officials could be making a much more potent case against Iran’s bad behavior in the Middle East if they weren’t so obsessed with Obama’s triumph. By making the nuclear deal the center of their concern, and by demanding the EU’s obeisance to Trump’s view of that deal as the central test of trans-Atlantic relations, they are pushing away our long-standing allies—and, ironically, giving Iran a free pass. As long as Iran’s genuinely disturbing actions (supporting terrorism, building ballistic missiles, pursuing an expansionist policy) are coupled to the nuclear deal (which Tehran is fully obeying), other countries will resist U.S. policies on both.

Meanwhile, on other matters in the Middle East, Pence and Pompeo condemned Iran’s role in the war in Yemen, but said nothing about Saudi Arabia’s even deadlier assaults there—while, at the same time, back home, the House of Representatives voted to end U.S. support of the Saudi campaign.

Trump is building an alliance that includes only Israel and the Sunni Arab nations of the Middle East, especially the Saudis and the United Arab Emirates—in effect, taking one side of a regionwide sectarian war, against Iran and the Shiites—at the cost of alienating other nations, including the Europeans, whose cooperation we need not only in that conflict but on other issues of still greater importance to us. And he is doing so without the support of what has been, until now, a pliant Congress.

Does Trump plan to go to war against Iran? If so, it would be a stupid move: Iran has twice the population, and nearly four times the area, of Iraq, and while many its people, especially in the cities, detest the regime and admire much about the West, these loyalties would shift dramatically in the face of an outright invasion.

Pompeo has said Trump wants to pressure the Iranian leaders into renegotiating the nuclear deal, but this is naïve at best. President Hassan Rouhani already risked plenty by signing an accord with the West. If the promised economic benefits don’t materialize, he could be replaced, likely not by Western-leaning democrats but by hard-line mullahs and the Revolutionary Guard. Even if Rouhani did have a freer hand, why—given Trump’s capricious pullout from this deal—should any Iranian trust him to abide by some future deal?

The only real problems with the nuclear deal are what it doesn’t address: There’s an expiration date for some of its provisions; it places no restrictions on ballistic missiles. But these complaints are true of all arms accords. The appropriate way to deal with these sorts of issues is not to toss out the deal but to build on it.

This was how the nuclear arms treaties with the Soviet Union, and then Russia, evolved: from SALT to the Vladivostok Accords to SALT II to START to New START—each deal restricting, then reducing, an expanding category of weapons. Some criticized those treaties for not barring short-range nukes or for not requiring Moscow to renounce communism. In the end, the Soviet empire and its ideology unraveled anyway; the exposure to the West, and the fact that negotiations did evolve, might have had something to do with that. (By the same token, though in reverse, renewed U.S.-Russia tensions, spurred by Vladimir Putin and his nostalgia for empire, are now jeopardizing the arms accords.)

The Iran nuclear deal, and the opening of that country to the West, may, over time, spark a breakdown in Tehran. Or maybe it won’t, in which case, if Iran is to remain a hostile power, better that it not be bristling with nuclear-tipped missiles. That was the logic behind making the deal. Trump rejected the logic but has nothing to replace it. He is reveling in sheer anarchy. The nothingness of the Warsaw conference should tell him that he’s spinning his wheels—but he still thinks he’s a high-speed racer in command of the road. That’s the definition of delusion—and danger.