The questions about foreign policy with the Middle East have always been complicated and there are rarely any clear cut answers. Making decisions about the ME usually involve weighing a whole lot of bad options and picking the best of the bad ones.
There are many roots to the problems and most of them go back deep into history.
1) Start with Israel/Palestine - The Jewish people have an ancient claim to that land. They were there for over 1000 years before the Romans moved most of them to the fringes to the Empire to end the rebellion. After they were moved, the people of the region moved into the vacuum and became the indigenous people. If someone can document a claim to land that hasn't been exercised in nearly 2000 years, is it still valid?
2) The crusades - In modern times the west has been interfering in the ME since WW I. In part the French and British thought they could expand their empires there and continue the Great Game. But western credibility in the region is not so great because the long memories of the peoples there about the last time westerners came to the ME during the Crusades. That didn't end well for either side. Western kingdoms eventually got driven out, but Islamic culture began to unravel from the strains of the conflict. The ME was the most learned part of the world when the Crusades began, but the aftermath started a long decline in learning. The Turks conquered much of the ME and had their time of empire. Many Islamic terrorist groups cite the Crusades as one of their rallying points.
3) The split between Shia and Sunni that goes back to the death of Mohammad. There was a split over who would control Islam after Mohammad's death. This split was also cultural. The Persians, modern day Iranians, formed the Shia sect. The Arabs mostly became Sunni. Religion is an expression of spiritual belief, but it's also an expression of the culture that spawned it and the Arabs and Persians are distinctly different cultures with distinctly different histories. Different Arab countries have different flavors of Sunni Islam, but mostly they get along with one another's religious differences. The animosity between Iran and Saudi Arabia today does have its roots in modern events, but there are also roots that are very ancient.
4) The Ottoman Empire - Largely forgotten by westerners today, the Ottoman Empire was the predominant government in the region only 100 years ago. Erdogan, being a fairly classic authoritarian dictator, wants to take Turkey back to it's heyday. This was even a theme in Nazi Germany with the Nazi's referring back to past glories of the German people. With Erdogan having influence over Trump and his desire to "put the band back together again" Turkey could be at the beginning of an attempt to rebuild the Ottoman Empire.
5) Hitler - This is something most westerners are not aware of, but the ideas of Hitler and the Nazis are very popular in the ME. The anti-Jewish messages really took hold as a rallying cry to stop what is seen by some as a modern western Crusade in the ME with a western culture transplanted to Palestine: Israel. Germans were generally well liked in the ME during the 19th century as western archeologists came to the region to do research. German archeologists tended to treat the natives with more respect then their counterparts from other western countries. When Hitler came along, his ideas got a listen because of the respect for Germans in general.
6) The Cold War - Both the USSR/Russia and the US meddled in the ME during the Cold War. The US mostly won the dominance game, but was kept in check by the USSR. Both made some big blunders we're still paying for. Among them the Soviet invasion of Afghanistan and the US response and the US/British coup in the 1950s that overthrew a democratically elected leader in Iran to put the Shah on the throne. In the aftermath of the Cold War the neocons misinterpreted the geopolitical situation and thought the US could do anything it wanted there which resulted in the US invasion of Iraq in 2003.
7) Oil - This forum has a lot of talk about getting off oil and that is definitely a great goal to work towards for many reasons. Among them is the geopolitical balance. The world's economy is entwined with oil like a vastly complex tumor with many arms. Too fast a withdrawal from the oil economy would be disastrous for the world economy. Much of the world's oil reserves are sitting under some unsavory players. The Russians have some significant reserves, Venezuela has quite a bit of heavy oil, and several ME countries not only have a lot of it, but also have some of the best quality crude in the world. Adding to this the US got the value of the US dollar directly linked to the value of oil in the 1970s. The US economy and the value of the US dollar are both heavily dependent on the oil market. The US has gone a long ways towards producing more of its oil domestically or with friendly allies (like Canada), but the dollar is still tied to oil. The oil industry is also a global industry. Even though the US does get by on Western Hemisphere oil for the most part, the price of domestically produced oil is determined by the global market. Anything that cut off ME crude exports would cause global oil prices to skyrocket and would impact the cost of fuel in the US just as hard as Europe, even though the oil was produced domestically.
All of these factors come into play with every ME decision. Good western leaders are aware of all these factors and more that I haven't listed. Bad western leaders may only see 1 or 2 and are completely ignorant of the minefields around the rest of the issues.
In the US there are different factions who have different opinions about what to do. The neocons think the US going to war over everything is the answer. There is a faction who think these are the "end times" and we need to let the end of the world play out. There are some who want to bury their head in the sand and hope it all works out. There are those who are ignorant of the background issues, but want to do something and end up advocating things that will make things worse. Then there are those who understand the problem quite well, know that some kind of action is needed, and try to come up with a plan that reduces the blowback knowing that some is inevitable.
The problem is that among this last group, every idea has large and negative implications. The arguments are about how bad each implication will be and inevitably everybody is going to get something wrong.
The ME is the Kobiashi Maru scenario of modern politics. Every option for a western power is bad and even those deeply in the know are at loggerheads about which options are worse than others.