In the small hours of 11 July 1958, three policemen entered the home of Mildred and Richard Loving, in Central Point, Virginia and found them in bed. When Richard pointed to his marriage certificate indicating that Mildred was his wife, they arrested them. Richard was white; Mildred was black and Cherokee. They were breaking the law, as laid down in Virginia's Racial Integrity Act, which banned mixed-race marriage.

The case eventually went to the US supreme court, which, in 1967, ruled in favour of the Lovings:

"Marriage is one of the 'basic civil rights of man', fundamental to our very existence and survival. Under our Constitution, the freedom to marry, or not marry, a person of another race resides with the individual and cannot be infringed by the State."

So, six years after Barack Obama was born in Hawaii to a white woman from Kansas and a black man from Kenya, mixed-race marriage was formally recognised as a civil right nationwide. (Some states kept their laws on the books, even if they were unenforceable. Alabama was the last to get rid of its anti-miscegenation law in 2000.) Said Mildred, many years later:

"Not a day goes by that I don't think of Richard and our love, our right to marry, and how much it meant to me to have that freedom to marry the person precious to me. Even if others thought he was the 'wrong kind of person' for me to marry."

Recently, a report by the Pew Research Center revealed that more than one in seven new marriages in the US is between people of a different race or ethnicity. The research revealed mixed-marriages now comprise 8.4% of all marriages in the US in 2010, more than double the proportion of 1980.

"Races do not intermarry," Martin Luther King once wrote. "Humans intermarry." But humans are not abstractions. We are moulded by the world we live in. It would be comforting, particularly in the west, to think that our romantic partners are chosen purely through desire and attraction. But it would also be deluded. The fault lines that shape of race, religion, age, ethnicity, nationality and so on that influence our lives in so many ways inevitably creep in to the most intimate settings. It would be strange if they didn't.

This is not some avant-garde leftist notion. From Shakespeare's Romeo and Juliet to Vikram Seth's A Suitable Boy, the notion that love does, indeed, know boundaries, even if it can, at times, overcome them, has been a literary staple through the ages. "It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife," says the narrator in the first line of Jane Austen's Pride and Prejudice. In Britain, it is still the case that no royal may ascend to the throne if they have married a Catholic (albeit this law is in the process of reform).

As recently as 1986, the issue of intermarriage was contentious: 28% of Americans said people of different races marrying each other was not acceptable for anyone, while 37% said this may be acceptable for others, but not for themselves, leaving just (33%) who believed intermarriage was acceptable for everyone. But as those born before the civil rights era died off, those raised without the dead weight of segregation on their imagination opened their minds. Today, 11% (still shockingly high, even if greatly reduced) believe society is worse-off because of increased intermarriage. Among the under 30s, it's just 5%.

These shifts were not a result of the innate liberal genius of the young or the inevitable influence of time and tide. It was politics. Had there been no civil rights struggle, no pressure on courts and the polity, these changes would not have happened as they did. "Men make their own history," wrote Karl Marx, in the 18th Brumaire of Napoleon Bonaparte:

"But they do not make it just as they please; they do not make it under circumstances chosen by themselves, but under given circumstances directly encountered and inherited from the past."

To compare these two struggles is not to equate them. To say homophobia and racism are the same would be ridiculous. As Quentin Crisp once said:

"The difference between being gay and being black is that you don't have to come downstairs one day and say, 'Mum, Dad, I'm black.'"

It goes without saying that there are major differences between race and sexual orientation. It also goes without saying that the existence of many black lesbians and gays makes the binary opposition of the two issues redundant. The problem with Crisp's joke is that it contains the implication you can't be both at the same time.

First, is the use of God and tradition to defend exclusivity and, therefore, exclusion. When the Lovings plead guilty in a Virginia Court in 1959, the trial judge, Leon Bazile, gave them a 25-year sentence – suspended, so long as they left the state – with the argument: "Almighty God created the races white, black, yellow, Malay and red," as a Virginia judge wrote in 1965, when he upheld the state's so-called Racial Integrity Act:

"And but for the interference with his arrangement there would be no cause for such marriages. The fact that he separated the races shows that he did not intend for the races to mix."

In 1971, when a American Civil Liberties Union lawyer argued the case for a gay couple's right to be married before the Minnesota supreme court, one judge turned his chair around and refused to look at him. The court rejected the case unanimously, citing the book of Genesis to support its decision. Religion is still the principal argument against gay marriage, and religious people are still those most likely to oppose it. Another Pew survey shows three in four white evangelicals are opposed to gay marriage (it's the only religious demographic where support for gay marriage did not increase between 2010 and 2011); that's roughly the same proportion as those who support gay marriage who are religiously unaffiliated.

Second, the campaigns to prevent these marriages are often rooted in repression and personal hypocrisy for crude electoral gain. During the Jim Crow era in the South, the issue was not whether black and white people could mix, in bed or elsewhere, but on what basis. White men slept with black women all the time, often by force. Strom Thurmond, who ran for the presidency in 1948 as a segregationist, fathered a black daughter in 1924. In the fifties, while he was Alabama governor, Jim Folsom highlighted the hypocrisy when campaigning in the "black belt" between Montgomery and Selma, where opposition to integration was strongest, pointing out that the large number of mixed-race people in the area didn't come from nowhere. "I want you to know that the sun didn't bleach 'em."

In a later gubernatorial campaign, he asked why white people were getting so worked up about the sacredness of segregation, when it looked to him as though there was "a whole lot of integratin' goin' on at night."

Finally, some of the same arguments, and even same statutes that were used during Jim Crow, are being used today to prevent gay marriage. In 1913, when Massachusetts was one of just a few states allowing interracial marriage, the state passed a law to prevent clerks from issuing marriage licenses to couples whose unions would not be legal in their home states. After the Massachusetts supreme court allowed gay marriage in 2004, the governor tried to resurrect that law, in order to stop gay couples coming from all over the country to get married there. His name? Mitt Romney. In order to kick the issue into touch, some Democrats – including, to his shame, President Obama – have refused to acknowledge gay marriage as a universal matter of equality; instead, saying it is an issue for each individual state. That is exactly the same argument that those supporting the slave trade made before the civil war.

"I believe all Americans, no matter their race, no matter their sex, no matter their sexual orientation, should have that same freedom to marry. I am still not a political person, but I am proud that Richard's and my name is on a court case that can help reinforce the love, the commitment, the fairness, and the family that so many people, black or white, young or old, gay or straight seek in life. I support the freedom to marry for all. That's what Loving, and loving, are all about."