> The court here isn’t necessarily creating legislation but rather are making the judgment/interpretation that “sex” does include sexual orientation.
No, the majority opinion is not doing that. It is not arguing that "sex" includes "sexual orientation". It is arguing that, in order to discriminate based on sexual orientation (or transgender), you have to also discriminate based on sex.
The dissents disagree with that argument. But both sides agree that "sex" does not include "sexual orientation"; they are distinct concepts.