They didn't, they legalized consensual sodomy between members of the opposite sex, for everyone.
There is not an equal protection component to the matter at hand.
There is no Constitutional basis for the federal government to extend a privilege of sodomy, or immunity from prosecution of it, to anyone. It's simply not a federal matter. There is no application of the 14th Amendment.
Had O'Conner persuaded a majority to hold with equal protection as the basis of the decision, it would have been even worse. If gays are a class for equal protection purposes, then gay marriage and adoption are mandated and gays can sue government agencies for discrimination under 1983.
So then, you would argue that a law banning Jewish religious ceremonies from being performed, and for people to participate in Jewish religious ceremonies, should not be considered as prejudiced because it treats everyone equally as it bans Gentiles and Muslims from performing or participating in Jewish religious ceremonies as well?