Did they arrive at this through the 14th amendment somehow? If so, how could they not see that homosexuality and race are fundamentally different? It's the difference in something you do versus something you are, at least from society's perspective. Isn't society allowed to pass laws that take behavior into account?
In 1965 in Griswold the Supreme Court first created a doctrine from the First, Fifth and Fourteenth Amendments that sexual identity, expression and self-determination were Constitutionally protected, holding in that case that Connecticut couldn’t limit unmarried women’s access to birth control. While one of its first progeny (Loving in 1967, striking down anti-miscegenation laws) made race a co-issue, it was quite clear that the doctrine did not depend any full equation of race with sexuality, or turn in any particular way on identity or immutable characteristics, versus conduct, at all. Roe in 1973 famously extended the doctrine to abortion — pure conduct.
In 1986, the Supreme Court rejected the doctrine as applicable to homosexuality in Bowers v Hardwick, but 1996’s Romer v Evans began to move the other way, and 2003’s Lawrence completed the reversal of course, finding a Constitutional entitlement to homosexual conduct and identity. The 2013 marriage cases unified the Loving and Lawrence streams of thinking.
So it will be exactly 50 years after Grisold when in June 2015 the Supreme Court will either uphold yesterday’s Utah decision or one just like it, or require all states to recognize a gay marriage legal where it was solemnized (two avenues which have the precise same result).