A Supreme Court ruling on Tuesday upheld state laws that ban transgender girls and women from playing in girls and women’s school sports.