Even though opposition to gay marriage has been a primary outlet for fear of change and fear of The Other for some years now, this is an issue on which the traditional relationship between marriage and homosexuality was indefensible from the start.
Historically, homosexual sex and the organization of one's life around a socially visible identity as gay were two quite separate phenomena. I believe that the opposition to marriage equality is really opposition to the final acceptance of gayness as a valid destigmatized way of life. But the opponents of marriage equality were maneuvered onto a battle field in which 99% of their forces were wiped out before the battle even started.
That process started by the middle to late 1800s.
In America in the 1800s, bachelors had lower status than married men. Heterosexual marriage for the purpose of social control and reproduction was de facto mandatory. So was active membership in some Christian church or other. Marriage partners were selected for practical, economic reasons and family, relatives, fellow church members, and the community at large had much influence on the selection of marriage partners. In particular, as long as most people lived in villages and small towns, social freedom was far more constrained. Also, there was far less understanding of identity in those days long before Freud. People were much more seen as whatever roles they publicly played. They also saw themselves more that way.
In this context, there was far less concern about actual homosexual sex. The active seeking out of those engaging in homosexual acts for persecution is more a later phenomenon. But most all homosexuals entered heterosexual marriages, followed accepted heterosexual norms (for example, supported their wives or husbands and had children).
Also, because heterosexual activity was more restricted, there were probably more people whose sexual orientation was actually heterosexual but who engaged in homosexual acts. This would also have impeded the formation of identification as gay by mixing together those for whom homosexuality was their second choice with those for whom it was their first choice.
As far as I know, homosexuality (publicly renamed gay around 1970; not sure how much earlier that term took hold within the gay community itself) as an identity and lifestyle only starts to arise in Europe and America in the 1800s. With more and more people living in larger cities and with more and more people working in non-agricultural jobs that provided greater separation of private life from work life, lives were freed from local control and more anonymous. This made it possible for all manner of non-conformities to take cultural shape. These appear first in small urban pockets of various bohemian lifestyles and arts. There were a few periods during which such pockets became more visible and influential. One is just before WW1. Another in the 1960s. (Perhaps 1848 would be another.) The impact of such communities is most visible in the arts and the humanities. Least visible in corporations.
Meanwhile, the changes foreshadowed by these exceptional communities were gradually taking hold in the broader society, with ups and downs and contradictions. A good example of one of the contradictions was that the 1950s were both a high point of freedom and support for love-based heterosexual marriages between freely chosen partners but also a high point for witch hunting of political and sexual non-conformists.
Nowadays, marriages are entered into as matters of personal choice and for primarily psychological and sexual reasons and left easily and frequently in the same manner. The right to believe or not believe whatever we want is taken for granted. The right to create whatever identity we want is taken for granted (born again, gay, Red Sox nation, marathon runner, bass fisherman, NASCAR fan, lover of fine wines, American idol fan, rock or country music fan) and actively used. This means that 99% of what used to enforce conformity to traditional behavior has been swept away. Few of those fighting against marriage equality challenge that sweeping away. Most of them are not even aware how much of it has happened.
That is why singling out of gays for exclusion from marriage rights was overthrown by a Republican judge. Although it is impossible to predict what a Supreme Court with so many right-wing ideologues will do.
By the way, the choice of marriage as the arena in which to contest the right of gay culture to full acceptance was tactically brilliant. Remember that before this battle began, gay culture was largely associated (and for gay men, not unfairly) with the heightened sexual freedoms common to much of 60s culture. With the backlash against sexual freedom even for heterosexuals and the rise of new sexually transmitted diseases, starting with genital herpes, this would have been a very difficult fight to win. But the demand for marriage equality was, in effect, a demand for gays to be allowed to be more like everyone else. And the reframing from "gay marriage" to "marriage equality" was also a nice touch. For myself, I am mentally filing this away under "how one wins cultural battles".