U.S. District Judge Ana Reyes said the policy is “soaked in animus” and discriminates against transgender people.