The ruling settles a long controversial divide on how schools approach transgender student inclusion in athletics.