We once were strong allies with the Shah of Iran. The country was very modern and West-leaning. In 1979, they had a religious revolution and took US hostages. Since then, US law has made clear that Iran is our sworn enemy. Both Democrats and Republicans have maintained this US policy. Since 1979, the Iranians have been the backers of many terrorists and terrorist groups.
The US has been allies of the Saudis and the other princes since we and the British put them in power a century ago. US companies have lots of involvement with the sheiks and their economies. Of course, the Sunnis have not been friends of the US since they raised oil prices drastically in the early 70's. The Saudis also had a religious takeover in 1979, but the sheiks bad a deal, where the Shah did not. The Saudis allowed the religious leaders to run the schools and to support terrorists throughout the world, including Al Qaeda and ISIS.
Obama moved along a goal of trying to start to deal with Iran, and of withdrawing from the region. Iran responded by continuing their terrorism. This became much more belligerent after Trump backed out of Obama's agreement and started "getting" tough on Iran. Iran has reacted with lots of violence.
==========
We cannot simply change overnight.
We have been allies to the sheiks for 100 years. We have considerable economic interests in their countries. What we can do is to reduce our military footprint, particularly by pulling all our troops out of the region other than from our Qatari and UAE bases, removing our Saudi bases, and stopping our support for the Saudi war with Yemen.
With regards to Iran, we can sit down with them and sign a new agreement which includes reductions in their export of terrorism through the region. Of course, it is difficult to distinguish between terrorism and war. In any case, we can allow them to sell their oil in the world market, and allow them to openly purchase technology.