The US Supreme Court ruled that states could exclude transgender athletes from girls and women’s sports teams.