There's an old saying "If at first you don't succeed, try, try again."
I don't recommend that Donald Trump take that advice.
In July of 2017, Trump issued forth a policy-by-tweet that took military brass by surprise: transgender troops would be banned. Almost immediately, the Joint Chiefs suggested they weren't opposed to thinking of it as a suggestion, rather than policy. And in October 2017, a federal judge temporarily blocked it, declaring it likely unconstitutional.
That didn't stop Trump from reasserting his ban, with the aid of James Mattis and Mike Pence (for whom this seems to matter most of all, can't imagine why) in yet another presidential edict-by-tweet move.
However, Friday, a US District Court judge in Seattle, upheld the injunctions and said that transgender troops in the military were a protected group and that the Trump administration had not made a good argument to justify the second attempt:
U.S. District Judge Marsha Pechman in Seattle on Friday decided the two bans are essentially the same, and denied the Justice Department’s request to throw the case out on the grounds that the new ban gives transgender troops and other plaintiffs a way to serve openly.
Trump announced in July, on Twitter, that transgender Americans would be barred from serving in the military “in any capacity.” That triggered at least four court injunctions, preventing the policy from taking effect while litigation proceeded. A March version of the ban, which Defense Secretary James Mattis said was crafted by military experts, would allow transgender people to serve openly in their “biological sex.”
“Requiring transgender people to serve in their ‘biological sex’ does not constitute ‘open’ service in any meaningful way, and cannot reasonably be considered an ‘exception’ to the ban,” Pechman wrote. “Rather, it would force transgender service members to suppress the very characteristic that defines them as transgender in the first place.”
[..]Pechman said in her ruling that because transgender people have long suffered from discrimination, the government must show that the new policy “was sincerely motivated by compelling interests, rather than by prejudice or stereotype.”
So that makes Judicial Branch 2; Trump administration 0 for transgender bans. Let's hope they don't try a third time.