If the birth-control pill had never been invented, perhaps American politics would be very different today.

Sex has consumed the political debate in recent weeks. To many it has been a surprising turn of events, given the near-universal prediction that this year’s election would be all about the economy. If the history of the bipartisan sexual counterrevolution were better known, no one would be surprised.

Conflicts over gay marriage, transvaginal ultrasounds, Planned Parenthood funding and insurance coverage for birth control are not isolated events. Rather, they are the latest expression of a 40-year-old shadow movement that has played an important role in fueling America’s political dysfunction.

Consider what America was like just 50 years ago. Americans could be arrested, fined and sentenced to prison for distributing birth control. Sex between consenting adults of the same sex was illegal in every state. Employment discrimination against women was pervasive and perfectly legal.

Everything changed in the space of roughly 15 years. The pill went on the market in 1960. Then the sexual revolution, feminism and gay liberation, in turn, revolutionized the family, the workplace and popular culture. By the end of the 1970s, Congress had outlawed gender discrimination in most areas of American life. Half of the states had repealed their laws against sodomy. The Supreme Court had ruled that statutes outlawing birth control and abortion were violations of constitutionally protected rights.

Today, most Americans take sexual freedom and gender equality for granted. But these were epochal changes. Given that government had long been in the business of legislating sexual morality and underwriting rigid gender roles, it is understandable that those who opposed these cultural transformations took their battle to the political arena.

The sexual counterrevolution was born in 1972, with a tiny group of women: far-right Republicans and Protestant fundamentalists who had never been particularly politically active before. Ironically, they were aided and abetted by their opposites: powerful liberal men, movers and shakers in the Democratic Party.

For the women, the rallying cause was defeating the Equal Rights Amendment. They viewed the ERA as undermining women’s God-given traditional role and, with it, an idealized nuclear family. These grass-roots activists lobbied successfully to block ERA ratification in just 15 states, sending the nationally popular amendment down to defeat. They then moved on to battle sex education in public schools, federally funded child care and gay civil rights. (Abortion, importantly, was not an early concern. Evangelical Protestants, for example, because of their strong support for separation of church and state, were largely pro-choice through most of the 1970s.)

These women, not the more famous Jerry Falwells and Pat Robertsons, were the ones who galvanized evangelical voters to create the powerful Christian right and, out of that crucible, the GOP as we know it today.

Since 1994, extremely conservative religious voters have constituted the largest and most powerful bloc within the Republican Party. They made up more than 40 percent of those who voted for George W. Bush and John McCain.

Rick Santorum’s rise in the polls on pronouncements like birth control is “not OK,” Mitt Romney’s flip-flops to the right on abortion and gay marriage, and moderate Republican Sen. Olympia Snowe’s retirement are all testaments to the continuing influence of the sexual counterrevolutionaries within the Republican Party.

But the sexual counterrevolution isn’t confined to the GOP; it has been a bipartisan affair.

The Democratic Party experienced its own backlash against the cultural revolution in the 1970s. After George McGovern lost the 1972 presidential election, party leaders and pundits blamed activists outside of the old party structure for the landslide defeat. “The American people made an association between McGovern and gay lib, and welfare rights, and pot smoking and black militants and women’s lib … and everything else that they saw as threatening,” the Democrats’ convention parliamentarian later concluded. In fact, however, polling shortly before the election showed that it was less voters’ perception of McGovern as a cultural radical and more their view of him as weak and indecisive that cost him the election. The flight of the white South to Richard Nixon over racial issues didn’t help.

But the old guard had a different view. “Unless we become acceptable to Middle America, we’ve had it,” Hubert Humphrey, who had lost to McGovern and his supporters, told Time. To this day, influential Democrats return to the theory that cultural progressivism explains every defeat. In the 1980s, “Middle America” was the Reagan Democrat; in the ’90s, Ross Perot’s angry white men; in the George W. Bush years, the Kansan who voted his values against his material interests.

Never mind that statistical studies done by, among others, sociologists Clem Brooks and Jeff Manza show that to the extent the so-called Reagan Democrats — Northern blue-collar white men — voted Republican, they based their vote on the economy and social welfare policies, not on gays and abortion. Indeed, many held progressive social views, which caused them to vote less Republican. In fact, in 1992, according to Emory University’s Alan Abramowitz, who studies party alignment, 1 out of 6 of such voters defected from the GOP because of its extreme antiabortion position.

The Democrats are the more progressive party on social issues, to be sure, but the fear of a largely mythic conservative Everyman doesn’t dissipate. A recent Kaiser Family Foundation poll showed 63% support for insurance coverage for birth control, and yet the Obama administration had backed away from its initial ruling on the subject. That the president is still “evolving” on gay marriage is another testament to the persistent influence of the Democrats’ own sexual counterrevolution.

All this matters not just for its contribution to the nation’s political dysfunction but also because of the toll it has exacted on millions of Americans.

One out of two of us lives in a community where it is legal to fire a woman because she is a lesbian, or to refuse to rent a house to a man because he is gay. The Defense of Marriage Act denies married gay couples the economic benefits our government bestows on married straight couples. Women make 79 cents for every dollar earned by men, and only 18 Fortune 500 companies are run by women, a gap many experts attribute more to the lack of public support for mothers in the workforce than to gender discrimination in the boardroom. The U.S. is one of only nine nations that doesn’t provide universal paid maternity leave.

The sexual counterrevolution represents a minority view in American democracy. Today, a solid majority of Americans support abortion rights, gay civil rights and other socially liberal positions; by a 2-to-1 or 3-to-1 margin, Americans oppose the extreme positions staked out by the right-wing sexual counterrevolutionaries on abortion and gay civil rights. Even on gay marriage, the balance has shifted toward more liberty and acceptance.

The counterrevolutionaries discovered early on that the American political system offers many ways around public opinion — delay and obstruction can hold back or nibble away at policies the majority desires.

As for the Americans denied opportunity and equality by the sexual counterrevolution, and for the majority that doesn’t want to go backward on civil rights and personal liberty, don’t expect unconditional surrender.

The culture war lives on, and will until the sexual counterrevolution ends.

Nancy L. Cohen is the author of “Delirium: How the Sexual Counterrevolution Is Polarizing America.” She wrote this for the Los Angeles Times. It was distributed by MCT Information Services