Those were achieved by
- acknowledging Congress may levy taxes, and issue tax credits for particular behavior (say, you’re taxed $X but get $Y credit in taxes for mortgage interest or having health insurance)
- acknowledging “equal protection” (i.e.: equal treatment) in light of long-accepted prohibitions regarding “orientation” discrimination.
Alas, these are well-established judicial principles - and those who know the law well enough can bend principles to their own strange goals.