Colleges and K-12 schools can determine eligibility for women’s and girls’ sports teams based on “biological sex,” the court ruled.