This is a demoralizing moment for combatants on the conservative side of the culture war. Every few days, it seems, a judge strikes down a state statute or constitutional amendment banning gay marriage. (The latest was in Texas.) The Supreme Court (or rather, Justice Anthony Kennedy) seems poised to nationalize gay marriage at any time. And of course there's the defeat of Arizona's anti-gay bill. The desperate effort of Arizona lawmakers to pass such a law in the first place (along with a similar ill-fated attempt in Kansas) recently inspired Andrew Sullivan to remark that we're living through the "death throes of the anti-gay movement."

That may well be right. But what if we're living through something even more significant? A poll released this week by the nonpartisan Public Religion Research Institute reinforces what a series of surveys have shown for years: An incredibly rapid and far-reaching shift toward public acceptance of both homosexuality and gay marriage. Indeed, PRRI's new numbers are so stunning that they inspired conservative culture warrior Rod Dreher to declare in no uncertain terms that "the culture war is over. The other side won."

When it comes to gay issues, I think he's right. (Abortion is another matter altogether.)

How did it happen? As I've argued before, the triumph of gay marriage can ultimately be traced back to the 2,000-year-old Christian ideal of equality. More recently, a shift in the definition of marriage took place after the introduction of the birth-control pill in 1957.

But there's more to it than that. The traditionalist religious position on homosexuality was bound to lose as soon as it stopped shaping American culture as a whole, and became, instead, the outlook of one subculture among many. And that happened in the mid-1960s.

(Much of what follows is adapted from my book The Religious Test.)

Up until that time, Americans, and indeed most men and women in the Western world, considered homosexual desires to be gravely evil and acting on them even worse. This judgment was accepted by nearly everyone, including most homosexuals themselves, many of whom lived lives shot through with shame, denial, and self-loathing.

Which is another way of saying that on matters of sexuality, Americans assumed a morality of ends, presuming that certain ways of living and acting are right or wrong in themselves, intrinsically, with their rightness or wrongness determined by the extent to which they conform to an ideal vision of humanity.

One version of a morality of ends is taught today by the Roman Catholic Church, in an idiom derived from the natural-law writings of Thomas Aquinas. Human sexuality, the church claims, is ordered by God toward the end of procreation, and sexual desires and activities that aim primarily toward other ends (such as pleasure or intimacy) are essentially disordered and offensive to God — in a word, evil. Traditionalists from other religious groups, now and in the past, may describe their beliefs in less philosophically rigorous ways, but when they denounce homosexuality or any other form of extramarital and/or non-procreative sex, they inevitably do so in terms of some stated or implied morality of ends.

But here's the thing: Our form of government isn't based on a morality of ends — and it isn't empowered to enforce one. It is based on and enforces a much more minimal morality of rights. Writing in the wake of Europe's religious civil wars, the liberal thinkers who most influenced the American constitutional framers (John Locke and Montesquieu) treated disagreement about ultimate ends as the normal condition of social life, and then sought to find common moral ground shared by every faction within society, regardless of the ends they pursued.

That common ground turned out to be a belief in individual dignity and rights to life and liberty that flow from it. Most liberals have also added rights to private property and the pursuit of whatever ends (including happiness, however defined) the individual affirms, provided that those ends do not infringe on the equal rights of anyone else to do the same.

But that leaves us with a puzzle: If liberal government is supposed to limit itself to upholding a morality of rights, how is it that the United States ended up with laws that forbade sodomy and policed other forms of sexual behavior when such laws are obviously expressions of a morality of ends?

Here's how:

The social and cultural consensus in favor of a morality of ends in sexual matters was so strong and so universally held that the government enforced it, despite its illiberalism. The consensus fundamentally shaped public opinion, which was echoed by elected public officials who wrote and enforced those restrictive laws. Meanwhile, no one thought to challenge those laws in the judicial branch of government; and even if someone did, judges (whose views are also shaped by public opinion) would have rejected it.

As long as the morality of ends regarding sexual traditionalism held as a near-universal consensus, illiberal laws policing sex were safe. But as soon as that consensus started to break down — as soon as significant numbers of citizens started to make the case for sexual freedom — the liberal state was poised to begin withdrawing from enforcement of the newly contentious morality of ends and substituting a more minimal morality of rights. Short of overwhelming cultural and social consensus in favor of a morality of ends, this will always be the default position of the liberal state.

From that point on, traditionalists would be perfectly free to continue adhering to their beliefs, but those beliefs would no longer have the force of law behind them because they now merely expressed the will of a part of society rather than the whole of society. What was once The Culture was now merely a subculture. (It remains an open question whether in the wake of the sexual revolution the U.S. has any unified culture at all — or if, instead, American "culture" is nothing more than the sum total of its subcultures.)

That's how the liberal state began its inexorable retreat from enforcing a morality of ultimate ends in sexual matters — a retreat still underway but lurching closer to completion every day (with efforts to reverse it doomed to failure).

It might sound obvious, but it's nonetheless true and too infrequently acknowledged: Conservatives lost the culture war in the 2010s because they lost the culture in the 1960s.