“Marriage is, and always has been through human history, a union of a man and woman,” says Rick Santorum. “Marriage,” claims Mitt Romney, is “critical for the well-being of civilization itself.” As more and more Americans across the political spectrum endorse same-sex marriage, its opponents are falling back on history. But the record on marriage and same-sex rights is not quite so clear-cut.

Historically, the singling out of same-sex relations as unnatural is a comparatively recent development. Like all Christian societies before them, the first colonists abhorred sexual immorality of all kinds, whether heterosexual, homosexual, or otherwise. Most of their law codes penalized adultery and sodomy equally, and sought to repress all unorthodox behaviour; in 1655 that of New Haven even mandated the death penalty for excessive masturbation.

In practice sex between men was only very rarely punished, even when communities seem to have been aware of what was going on. It was only in the course of the 20th century that “homosexuals” came to be defined as dangerous, unnatural deviants, and subjected to increasing legal and social discrimination, by the federal government, by the states, and by local communities.

This 20th-century campaign of persecution, which reached a peak in the 1950s, was unprecedented. And it did not last. Over the past few decades it has been replaced by an increasing acceptance that, as the Supreme Court affirmed in 2003, the sexuality of gay people, as of heterosexuals, is a private matter. Our attitudes have changed more than once: there is no age-old American tradition of denying equal rights to homosexuals.

Nor is marriage a timeless, unchanging institution. Quite the opposite: throughout Western history its form has been constantly evolving and contested. Throughout the Middle Ages the precise definition of marriage was notoriously unsettled. After the Reformation it was complicated further by the various innovations adopted by different Protestant churches, such as divorce and remarriage. As Thomas Hobbes pointed out in 1642, the law of marriage had become so confused that “copulation which in one city is matrimony, in another will be judged adultery.”

It was partly to sort out this mess that secular governments originally took over the business of defining and periodically revising the rules of marriage. “Thank God!” exclaimed Sir Dudley Ryder, the British attorney general, in Parliament in 1753, rejecting the idea that marriage was an immutable divine institution, “we have in this age got the better of this, as well as of a great many other superstitious opinions.”

That has always been the American attitude too. Both before and since independence, marriage has been always been a civil, not a religious matter, and state and federal laws have repeatedly redefined its boundaries. Throughout the 19th century, tens of thousands of Mormon Americans practiced polygamy, following obvious biblical precedents. Interracial marriage was once widely prohibited as “unnatural.” Marital laws and public attitudes have changed dramatically on that point in recent decades, as they have with respect to women’s rights and to divorce. The definition and practice of marriage has been evolving for millennia, in line with social changes.

Even same-sex unions of various kinds have a long history. They are documented, for both men and women, not just in classical Greece and Rome, but in more recent Western societies too. Jamestown, the first permanent English settlement in North America, was named after King James I, who conceived of his relationship with the Duke of Buckingham as a kind of “marriage.” “Marrying” was also how homosexuals in 18th-century London referred to their private pairings-off with each other. And the diary of Anne Lister in the 1820s poignantly records her use of the rituals of wedlock (rings, church services, the taking of communion) to solemnize her sexual relationship with another woman. Same-sex marriage is an old idea.

Its increasing legalization across the Western world over the past quarter century is not, therefore, a radical innovation, but merely the latest stage in the continually evolving history of marital customs and of attitudes toward homosexuality. Nor does it undermine American values, because those have never been based in any particular definition of marriage. On the contrary. American civilization is built on the ideals of personal freedom and equality. And that is what the movement for same-sex marriage is about.