As President Trump escaped a Washington shocked by his efforts to nix an FBI investigation into his campaign’s alleged collusion with Russia during the 2016 election, he landed in a Middle East in which endemic tension and conflict are far worse. It became obvious during his stops there that the president wants the United States to align even more with Israel and the Arab Sunni states against Shia Iran.

This development will please those nations, who worried about greater U.S. rapprochement with the Iran, based on that country’s signing a deal with the world’s great powers, including the United States, suspending its nuclear program in exchange for relief from economic sanctions. Israel and the Arab Sunni states had rocky relations with the Obama administration, because it had led the international drive toward the nuclear deal, which to their chagrin even the Trump administration acknowledges Iran is honoring.

The United States also has technically honored the deal by terminating U.S. sanctions imposed against Iran’s nuclear program, but it has retained sanctions against that country’s missile program and its sponsorship of terrorism. The remaining sanctions rankle Iran because they continue to cast a shadow over its international commerce, especially on important financial transactions.

Despite disappointment in Iran with the results of the nuclear deal, the country just decisively re-elected Hassan Rouhani, its main architect. The 57 percent of Iranians who voted for Rouhani want more outreach to the West, more foreign investment to goose Iran’s rickety economy (resulting from prior international sanctions and excessive government intervention in the economy), more individual freedom, and the release of opposition leaders. Because of Rouhani’s impressive election margin—the next candidate to him, a hardliner, got only 38 percent of the vote in a high-turnout election—he has the power of the people to leverage against Supreme Leader Grand Ayatollah Ali Khamenei and also the weakened hardline faction.

Yet notwithstanding this favorable result, Trump doubled down in support of Iran’s Sunni enemies, of which Saudi Arabia is the regional ring leader.

Although Iran leaves a lot to be desired in safeguarding human rights, it is better than Saudi Arabia, the 11th worst country in the world in ensuring political rights and civil liberties (according to Freedom House); Iran is also more democratic than the Saudi kingdom.

Both Iran and Saudi Arabia have recently directly or indirectly promoted competing versions of militant Islam, which have spawned terrorism. Iran’s sponsorship of Hamas and Hezbollah has mainly affected Israel, whereas U.S. ally Saudi Arabia’s militant Sunni ideology has contributed to the rise of al- Qaeda and ISIS worldwide. Which is more of a threat to the United States?

Therefore, although Iran is far from a paragon of liberal democracy and human rights, neither are its Sunni opponents in the Middle East, including Abdel Fattah al-Sisi’s Egypt, which is worse than was his predecessor Hosni Mubarak’s autocratic regime on such issues.

So why, in the face of the Iran nuclear agreement and the promising re-election of Rouhani, did Trump double down on alignment with the autocratic Sunni states instead of running a more even-handed policy in the Middle East by continuing the Obama administration’s improvement in relations with Iran?

Oil, that’s why. The United States has always let Saudi Arabia get away with murder (literally, because 14 of the 19 hijackers on 9/11 were Saudis), because it regards that nation as the leader of the OPEC oil cartel and the world’s “swing” oil producer. If Saudi Arabia had as much power over the global oil market as U.S. policymakers think it does, maybe that would be a necessary compromise, but it doesn’t.

OPEC’s oil embargo in 1973, which created gas lines in the United States, is still seared into the collective memory of the U.S. government. But that memory is flawed, because the embargo actually failed. Industrial economies are fairly resilient to oil shocks and the gas lines in the United States were caused by government controls on the price of oil. Demonstrating that the oil embargo failed, subsequent wars in the Middle East have brought no more embargoes.

More generally, OPEC has always been a paper tiger, plagued by secret cheating on oil production as the oil price increases. Like most resource cartels, such cheating makes them ineffective, and OPEC has not been very successful in raising the long-term price of oil above what a free market would have produced. And with the fracking boom again making the United States the world’s largest oil producer, the United States has even less incentive to coddle the Saudis.

Finally, many Persian Gulf states, including Saudi Arabia, get more than 80 percent to 95 percent of their export revenues from fuel and therefore need to sell their oil more than consuming nations need to buy it.

Thus, if President Trump learned more about the oil market and the Middle East, he would wisely continue Obama’s effort to run a more even-handed foreign policy toward the region. But alas, he doesn’t seem to have the curiosity or the inclination.