The ruling means certain transgender people can be barred from joining or staying in the military.