As I have said before, recent US administrations, both Republican and Democratic, both under President Bush and President Obama, have been amazingly naive, and even frankly clueless, in the bewilderingly Byzantine politics of the Middle East. Administrations and politicians keep thinking in simple Western, black-and-white, enemy vs friend terms. But what is really happening in the Middle East is a complex ever-changing dance of alliances being made and broken moment by moment as opportunities change. No one is anyone's permanent friend, or permanent enemy. Underlying this is a web of mutual ethnic and religious hatreds deeper and more irrational that most of us in the West (expect, perhaps, for Northern Ireland) can imagine, though we too once had that depth of hatred, in the centuries of Catholic-Protestant wars.
To get just the barest taste of this, read Adam Garfinkle's current article in The American Interest: Mullah Dreams: Not Counting Sheep. The complexity will make your head swim!