Prohibiting pre-marital sex (like Baylor does in their Honor Code) is non-discriminatory because no one, whether gay or straight, can have sex unless they are married. This worked for decades…until gays could marry.
Now the analysis has changed to prohibiting premarital sex AND prohibiting marital sex ONLY if you are gay. This policy is now discriminating against gays (at least from the perspective of the courts and nearly every public university).