This was an activist endorsement of sodomy with whatever excuse it took. The Supreme Court is not infalible and even overturned its own earlier decision (different judges).
The Supreme Court has changed it opinion on a number of decisions throughout the years.