In the last 25 years or so, the attitude of Courts toward people making rights claims about sexual orientation has undergone a stark reversal. The Supreme Court of 1986 in Bowers v. Hardwick thought it "at best facetious" to claim that the constitution prevented states from making the intimate relationships of gay people a crime. By 2003, the Court said gay people had the right not to have their relationships "demeaned" by laws that did just that. Lawrence v. Texas.
It might be nice to think the change reflects a deeper understanding of the constitution and how it ought to work. But while there may be some of that going on here, it's probably not most of the explanation. The 2003 Supreme Court (and today's Court) was far less open to individual rights claims than the Court of 1986. And the changed attitude toward gay people came in decisions that are less than models of sophisticated constitutional thinking (though I think they are actually far better than many find them).
More than anything else, the evolution in the thinking of courts reflects a deep change in society's understanding of gay people. Until quite recently, it was widely accepted that gay people were different in kind-totally different-from heterosexuals. We were thought to be unstable, immoral, and incapable of serious emotional commitment. For a good example, take a look at Dr. David Reuben's supposedly groundbreaking honest book about sexuality, "Everything You Always Wanted to Know About Sex." He describes gay relationships as fleeting, empty and devoid of emotional connection (make sure you look at the 1968 version, before he started cleaning it up). Reuben is crude, but the attitudes he expresses enjoyed widespread acceptance. I actually got laughed at in Court in 1979 (by the judge and the D.A.) for suggesting that sex was sex no matter the sex of the participants. In California.
Cases about same-sex marriage from the last generation show the thinking in sharp relief. In 1974 the Washington Court of Appeals in Singer v. Hara famously turned away a marriage case by explaining there was no discrimination involved in refusing to let a same-sex couple marry; the very nature of marriage (not its legal definition) required a man and a women. It isn't discrimination to have the east coast always an hour ahead of Chicago. It's just reality. So too the Singer court thought with marriage.
What a difference a generation makes. The Lawrence Court ruled that gay people have the same right to sexual intimacy that straight people have. Twice it drew explicit parallels between heterosexual and homosexual intimacy. And Justice O'Connor, who signed the majority opinion in Bowers, said in so many words that the only difference between same-sex and opposite-sex intimacy was the participants. Windsor came even closer to saying there is no difference between gay people and straight people. It allowed that states could conclude that the relationships of same-sex couples were entitled to the same dignity as heterosexual relationships. The Utah marriage decision, like most of the other recent marriage cases, is built on what is the new understanding in America: in the range of emotional connections, there is no difference between gay people and straight people.
Once it began to seem clear that as a matter of fact there was no real difference between gay people and straight people, the legal success of gay rights claims became virtually certain. That is why courts increasingly agree on the outcome if they can't quite agree on the constitutional reasoning (i.e. the first Circuit thought DOMA invalid under heightened rational basis, the second under intermediate scrutiny, the Supreme Court under the rule against inequality for its own sake). And that is surely why both the District Court in Utah and the 10th Circuit refused to issue stays while the case is on appeal, something the 9th Circuit did just three years ago on a far shakier legal basis than the Courts in the Utah case would have had.
Convincing America that gay people and straight people are fundamentally the same was the great challenge the gay rights movement faced. The lawsuits that made that point through the stories the cases told about the lives of the people involved were a critical part of that job of persuasion. But it was that change in understanding about who gay people are, not so much the law, that's gotten us here, both in court and out.