There seems to be a lot of confusion about how to go about stopping terrorism. Many people foolishly advocate a “Kill 'Em All, Let God Sort 'Em Out” attitude towards the Middle East and believe that violence is the answer. There is a large problem with the so-called solution of these war mongers, however. They do not understand the history of the region and their views are horribly short-sighted and counterproductive.
While I am by no means an expert on the Middle East, I've been reading a lot of books about US foreign policy the last several months, and the history of US involvement there, along with Middle Eastern history in general. I firmly believe I know what is driving many of these extremists and it's not mostly religion, as a few of my Skeptic Ink colleagues believe it is. How will I demonstrate this? By citing the very words of those responsible for the terrorist attacks and the mostly non-religious grievances the Arab world has against the US.
What Specific Grievances Does the Middle Eastern World Have Against the US?
I have covered this topic in relation to the drone war, but I have not discussed the long-lasting grievances that Muslims harbor due to US actions in the region for the last several decades.
Contrary to the US propaganda it is not a “hatred” of Western values or democracy or even freedom that causes much of the Muslim world to hate the US. As a matter of fact, the bulk of the Arab world want precisely that: democracy and freedom. In addition, contrary to many atheist bloggers religion is also not as much of a factor as is often claimed.
It is precisely the actions in the Middle East by Western powers that have so turned the Muslim world against the US. Such actions include: In Iran, in 1953, the CIA aided MI6 (Britain's Intelligence Service) in overthrowing the democratically-elected leader Mohammad Mosaddegh because he wanted to nationalize Iran's oil. Due to the US and Europe's interest in Middle Eastern oil (and nothing has changed since) these two governments did not like Iran pushing out US and European interests so they decided to overthrow Mosaddegh. In his place, the Shah, who was much more favorable to US and European oil interests, implemented a brutal dictatorship that committed many human rights violations, including torture. The Truman administration turned a blind eye to these atrocities.  To quote Fawaz A. Gerges, a professor of Middle Eastern Politics, on this issue:
American officials overlooked how Iranian opinion would view their intimate associations with the shah, especially (as his regime matured) his repressive policies and widespread violation of human rights. Iranians viewed America as an accomplice of their tormentor, as providing him with pivotal political and military support and bolstering his rule. Anti-American sentiment took hold of the Iranian imagination. 
An enormous factor that has enraged the Arab world against the US is the West's unwavering support of Israel. After the first World War Britain's control over Palestine became a heavy burden due to the opposition of the native Palestinians who wanted freedom and independence. Britain turned the problem over to the United Nations who convened a panel of eleven members to solve the issue. Australia, Canada, Czechoslovakia, Guatemala, India, Iran, Netherlands, Peru, Sweden, Uruguay, and Yugoslavia discussed how to resolve the issue. Eight out of the eleven members eventually decided upon partitioning Palestine into Arab and Jewish states. The states that voted against the resolution (Iran, India, and Yugoslavia), as it turns out, correctly predicted that this solution would lead to much more violence.  The US began to actively support Israel during the Truman administration, who lobbied Congress to partition Palestine into Arab and Jewish territories. 
Anger towards the US in the Arab world intensified after the 1990 invasion of Iraq into Kuwait, and the ensuing international coalition, lead by the US, nicknamed Desert Storm, to expel Iraqi forces. Despite the outward appearance of good intentions by the US, the fact remains that the US used this war as a pretext to “consolidate American control of the oil fields by establishing permanent military bases in the Saudi kingdom.” 
Enter Osama bin Laden and the rise of Al Qaeda.
It was after the invasion of the US during Desert Storm that Al Qaeda began attacking US troops stationed in the Middle East and attacking US interests in the region. The first attack came on December 29, 1992 in Yemen when Al Qaeda detonated a bomb at the Gold Mohur hotel, where US troops had been staying. The troops had already left earlier prior to the explosion, but the blast killed two Australian tourists. It was the belief of bin Laden and other Arabs that “American actions in the Gulf War and afterward” were “part of a US conspiracy to establish military bases and dominate Muslim lands and siphon away their oil resources.” 
However, it was ten years earlier when the US first earned bin Laden's ire. This was the US's support of Israel's 1982 attack upon Lebanon that slaughtered thousands of innocent civilians. Bin laden explains his reasoning behind his ideological shift:
The events that affected my soul in a direct way started in 1982 when America permitted the Israelis to invade Lebanon and the American Sixth Fleet helped them in that. The bombardment began and many were killed and injured and others were terrorized and displaced I couldn't forget those moving scenes, blood, and severed limbs, women and children sprawled everywhere. Houses destroyed along with their occupants and high-rises demolished over their residents rockets raining down on our homes without mercy […] 
This excerpt is just a small part of a transcript of a speech given by bin Laden, explaining his motivations for his attacks upon the US. Here is the bulk of that transcript. Pay close attention to his reasons. Does religion crop up as a main reason, or is it the murder of thousands of innocent people at the hands of the US and their allies?
The events that affected my soul in a direct way started in 1982 when America permitted the Israelis to invade Lebanon and the American Sixth Fleet helped them in that. The bombardment began and many were killed and injured and others were terrorized and displaced I couldn't forget those moving scenes, blood, and severed limbs, women and children sprawled everywhere. Houses destroyed along with their occupants and high-rises demolished over their residents rockets raining down on our homes without mercy […] This excerpt is just a small part of a transcript of a speech given by bin Laden, explaining his motivations for his attacks upon the US. Here is the bulk of that transcript. Pay close attention to his reasons. Does religion crop up as a main reason, or is it the murder of thousands of innocent people at the hands of the US and their allies?
People of America this talk of mine is for you and concerns the ideal way to prevent another Manhattan and deals with the war and its causes and results. Before I begin, I say to you that security is an indispensable pillar of human life and that free men do not forfeit their security contrary to Bush's claim that we hate freedom. If so, then let him explain to us why we didn't strike -- for example -- Sweden. And we know that freedom haters don't possess defiant spirits like those of the 19. May Allah have mercy upon them.
No we fight you because we are free men who don't sleep under oppression. We want to restore freedom to our Nation and just as you lay waste to our Nation, so shall we lay waste to yours. No one except a dumb thief plays with the security of others and then makes himself believe he will be secure whereas thinking people when disaster strikes make it their priority to look for its causes in order to prevent it happening again. But I am amazed at you even though we are in the 4th year after the events of Sept 11th. Bush is still engaged in distortion, deception and hiding from you the real causes. And thus the reasons are still there for a repeat of what occurred. So I shall talk to you about the story behind those events and I shall tell you truthfully about the moments in which the decision was taken for you to consider. I say to you Allah knows that it had never occurred to us to strike the towers, but after it became unbearable and we witnessed the oppression and tyranny of the American Israeli coalition against our people in Palestine and Lebanon it came to my mind.
The events that affected my soul in a direct way started in 1982 when America permitted the Israelis to invade Lebanon and the American Sixth Fleet helped them in that. The bombardment began and many were killed and injured and others were terrorized and displaced I couldn't forget those moving scenes, blood, and severed limbs, women and children sprawled everywhere. Houses destroyed along with their occupants and high-rises demolished over their residents rockets raining down on our homes without mercy the situations was like a crocodile meeting a helpless child powerless except for his screams. Does the crocodile understand a conversation that doesn't include a weapon? And the whole world saw and heard but didn't respond. In those difficult moments, many hard-to-describe ideas bubbled in my soul, but in the end they produced an intense feeling of rejection of tyranny and gave birth to a strong resolve to punish the oppressors. And as I looked at those demolished towers in Lebanon, it entered my mind that we should punish the oppressor in kind and that we should destroy towers in America in order that they taste some of what we tasted and so that they be deterred from killing our women and children. And that day, it was confirmed to me that oppression and the intentional killing of innocent women and children is a deliberate American policy. Destruction is freedom and democracy while resistance is terrorism and intolerance. This means the oppressing and embargoing to death of millions as Bush Sr. did in Iraq in the greatest mass slaughter of children mankind has ever known and it means the throwing of millions of pounds of bombs and explosives at millions of children -- also in Iraq -- as Bush Jr. did in order to remove an old agent and replace him with a new puppet to assist in the pilfering of Iraq's oil and other outrages. So with these images and their like as their background, the events of September 11th came as a reply to those great wrongs. (emphasis mine)
All of these historical events have created much hostility towards the West in the minds of Arabs across the Middle East. It has been these events, and the continuing drone attacks in the Middle East, and the continuing establishment of military bases there, that continue to inspire hatred against the US.
Having laid out my case (a very strong one I believe) that the root cause of Arab hostilities is US foreign policy in the Middle East I cannot forget the role that religion does indeed play. One of the greatest roles is the fact that US forces have occupied Muslim lands and they see this as an insult to their religion. A poll from 2007 highlights these political and religious reasons.
[A]n average of 79 percent of respondents in Egypt, Morocco, Pakistan, and Indonesia agreed that the United States had sought to “weaken and divide the Islamic world”; a similar percentage believed that America wanted “control over the oil resources of the Middle East.” An average of 64 percent contended that Washington wanted to spread Christianity in Muslim lands. Three-fourths of the respondents in the four countries supported the goal of getting American troops and bases out of the region. 
I wanted to give an overview (which do not even take into account many other actions in the Middle East, including Obama's drone wars and Europe's virtual theft of Iranian oil in the early 1900's ) of the various grievances the Middle East has with the US and how many people in the region perceive US actions. This historical context must be understood if we are to offer reasonable and long-lasting solutions to these conflicts.
Possible Solutions to the Conflicts
Now that we understand the historical backdrop of the current events we can discuss possible political solutions to these conflicts. First, I've already covered elsewhere why a law enforcement approach is the best way to stop and detain those who may or have caused harm to innocent people. It is more effective at stopping the cycle of violence and it helps to prevent the harm of innocent bystanders. Second, by going after the root of these conflicts a long-lasting peace is much more likely to be struck and maintained. Once past grievances have been put aside, the cycle of violence can stop, and healing can begin, and a newer future for these countries can begin.
1. Urge the US to attempt to make amends for past and current misdeeds, such as the overthrowing of the democratically-elected Mosaddegh in Iran and support for other dictatorships in the region, such as Hosni Mubarak (before his ouster at the hands of the Egyptian revolution), Libyan dictator Muammar Gaddafi (prior to his overthrow and murder at the hands of the National Transitional Council forces), and the current Bahraini dictatorship, which hosts the US Navy's fifth fleet.
2. Stop the economic and military support of Israel. I believe it would be most fair to move all settlements back to the pre-1967 borders, per the United Nations Security Council Resolution 242, which states:
(i) Withdrawal of Israel armed forces from territories occupied in the recent conflict;
(ii) Termination of all claims or states of belligerency and respect for and acknowledgement of the sovereignty, territorial integrity and political independence of every State in the area and their right to live in peace within secure and recognized boundaries free from threats or acts of force
Due to the US's large amounts of economic and military aid it should not be that difficult to force Israel's hand in the matter.
3. Remove all military bases and service members from the Middle East.
4. Pay reparations to Iraq, Iran, Palestine, and every other Middle Eastern country the US has harmed due to its foreign policy decisions (invasions, economic sanctions, sabotage (the Stuxnet virus that the Obama administration released upon Iran's nuclear facilities come to mind), etc.). 
5. Help prop up the economies of many Middle Eastern countries that have been damaged by US sanctions, US interventions, and terrorist activities. Raising up the economies will starve the radical Muslim population of the support they gain by the destitute living conditions and US actions. In this way, radical groups will be marginalized, rather than strengthened, as is happening now with the US's current policy decisions in the region. To quote Jeremy Scahill on the issue,
But, as happened in Afghanistan, Iraq, and elsewhere, this strategy appear[s] to fuel the movements that created those “bad guys” in the first place. “If you use the drone, and the selected killings, and do nothing else on the other side, then you get rid of individuals. But the root causes are still there,” observed the former Somali foreign minister, Ismail Mahmoud “Buubaa” Hurre. “The root causes are not security. The root causes are political and economic.” 
I've laid out the motivations of the radical Muslim groups and have shown that violence will not solve the core issues. What needs to happen is a stop to the cycle of violence and a true reconciliation. Only by following many of the above guidelines and resolving long-standing grievances can the tension and hostilities finally end.
1. Understanding Iran: Everything You Need to Know, From Persia to the Islamic Republic, From Cyrus to Ahmadinejad, by William R. Polk, Palgrave-Macmillan, 2011; 111-115
2. Obama and the Middle East: The End of America's Moment?, by Fawaz A. Gerges, Palgrave-Macmillan, 2013; 40
3. Treacherous Alliance: The Secret Dealings of Israel, Iran, and the U.S., by Trita Parsi, Yale University Press, 2007; 19-20
4. Obama and the Middle East; 31
5. Understanding Iran; 62
6. Obama and the Middle East; 63
7. The Washington Post: “Transcript: Translation of Bin Laden's Videotaped Message” November 1, 2004 - accessed 9-11-13
8. Obama and the Middle East; 7
9. Understanding Iran; 95
10. The New York Times: “Obama Order Sped Up Wave of Cyberattacks Against Iran” June 1, 2012 - accessed 9-13-13
11. Dirty Wars: The World is a Battlefield, by Jeremy Scahill, Nation Books, 2013; 494