For many on the American left and right, the "Arab Spring" has become the "Arab Winter" of triumphant fundamentalists. In Egypt, where Arab liberalism was once strong, religious parties overwhelmed secularists in recent parliamentary elections. An Islamist is now certain to be elected president, provided the military does not intervene, and a referendum that would likely down the Israeli-Egyptian peace treaty is probably in the future.
But Westerners should resist nostalgia and depression. Given the awfulness of post-World War II Arab lands, where even the most benign regimes had sophisticated, torture-happy security services, Islamists who braved the wrath of rulers and trenchantly critiqued the moral breakdown of their societies were going to do well in a postsecular age. What is poorly understood in the West is how critical fundamentalists are to the moral and political rejuvenation of their countries. As counterintuitive as it seems, they are the key to more democratic, liberal politics in the region.
The case for a separation of mosque and state has been harder to make in the Middle East because most Muslims have not been burned by internecine strife. The West has become an unrivaled liberal paragon in part because its past savagery was so intense. Westerners now instinctively compartmentalize their faith and temper its expression because their Christian forefathers killed each other zealously over religious differences.
Islam hasn't seen the sustained barbarism that plagued European Christian and post-Christian—communist and fascist—societies. Reform-minded Muslims have usually critiqued their faith with an eye to the West, to the secrets of European power, without appreciating both the highs and lows of Occidental history.
A hundred years ago, the most consequential Muslim intellectuals were mostly progressive men who tried to work out a synthesis between the West and Islam. The Middle East's post-World War II rulers, however, merely dictated that the Muslim clergy and the faithful change their ways. Against the seductive power of nationalism, socialism and communism, which in the hands of military men ran roughshod over much of the Middle East, Islam stood as a barrier to "progress."
As the imported Western ideologies ended in tyranny, Islam became a haven, a repository of virtue and memories, both real and imagined, of better times, when rulers and the ruled abided by the same religious law. The all-purpose fundamentalist cry, "Islam is the answer," is as much a critique of what had been tried and failed as it is a tendentious reading of history.
Among Shiite Muslims, the mullahs became poles of resistance. Among Sunni Muslims, whose clerics have been closely allied to the state, devout laymen took the lead in opposition. What ought to be obvious now is that Muslims cannot be dragged dictatorially to an embrace of secularism and all the liberal values that spring from it. They have to arrive voluntarily, organically, at this understanding.
Slavery is de facto no longer permitted in Islam—even though it's authorized by the Quran—because Muslims successfully grafted European ethics onto Islamic mores. (British warships also helped stop the trade.) Individualism, the most insidious of Western exports, has now penetrated deeply into Muslim societies. The Muslim Brotherhood, for example, recognizes a woman's equality inside the voting booth.
We can easily find truly disturbing commentary and actions by members of the Egyptian Brotherhood, or by the Tunisian Rachid Ghannouchi, the intellectual guru behind the ruling Nahda Party. But we can just as easily find words and deeds that ought to make us consider the possibility that these men are neither Ernest Röhm and his fascist Brownshirts nor even religious versions of secular autocrats. Rather, they are cultural hybrids trying to figure out how to combine the best of the West (material progress and the absence of brutality in daily life) without betraying their faith and pride.
We know that in Iran, under theocracy, once die-hard members of the revolutionary elite have become proponents of evermore liberal democracy. Fundamentalists became fundamentalist critics. The Islamic Republic's controlled elections created a powerful appetite for real ones.
In Arab lands, militant Muslims who once espoused violent revolution now back representative government. They do so, in part, because they know how powerful the appeal of democracy is among the faithful. They also do so, as Iraq's Shiite clerics have made clear, because they are certain that free Muslims voting can't do worse than the Westernized dictators before them. Democracy is thus a means to keep Muslims more religious whereas theocracy actually secularizes society.
This view is potentially very strong among Sunnis who don't recognize the possibility that a majority of Muslims can err in their collective judgment. It is certainly possible that Arab Islamists will try to abort democracy once they gain power, fearful of how free men and women might act. But there will be enormous resistance from the faithful.
Arab Muslims have little idea yet where the red lines are—where parliamentary power, the Holy Law and tradition collide. In Iraq, where this collision is the most advanced, we have seen the clergy and secular laymen both give ground on sensitive issues.
As is already happening in Egypt, we will see debates revolving around issues that will turn Western stomachs—such as the exclusion of Christians and women from official positions, and the permissibility of clitoridectomy and childhood brides. Though the outcomes may be distressing, this is not surprising. If a secular, semi-democratic Turkey guided by Europeanized generals constantly mistreated its religious and ethnic minorities, we can be certain that much less Westernized Arab lands are unlikely to be notably more tolerant.
But democracy, even if vastly more limited than current Western practice, always introduces a jousting ethic into politics. Representative government puts into play the sacred and the profane. It empowers women, the Achilles' heel of Islamic fundamentalism. In Egypt, it pits Muslim Brothers against more hard-core Salafists. Secular Muslim liberals may one day form a government. But for now, they are too culturally close to the West, and to the Westernized dictators, to carry their societies with them.
Fundamentalists, however, are near the mainstream. Washington should be under no illusions: They will be neither our friends nor allies. But their debates with each other and with the region's still-kicking nationalists, socialists, communists and liberals will get evolution rolling. Down that tortuous path lies the possibility of less angry relations between Islam and the West. Dictatorship nostalgia, on the other hand, will take us right back to the cul-de-sac where Osama bin Laden was born.
Mr. Gerecht, a former Middle Eastern specialist in the CIA's clandestine service, is a senior fellow at the Foundation for Defense of Democracies and the author of "The Wave: Man, God, and the Ballot Box in the Middle East" (Hoover Institution Press, 2011).