The justices lifted nationwide injunctions that had kept the administration's policy from being implemented. The Trump policy reverses an Obama administration rule that would have opened the military to transgender men and women and instead bars those who identify with a gender different from the one assigned at birth and are seeking to transition.
The court's five conservatives - Chief Justice John Roberts Jr. and Justices Clarence Thomas, Samuel Alito Jr., Neil Gorsuch and Brett Kavanaugh - allowed the restrictions to go into effect while the court decides whether eventually to consider the merits of the case.
The liberal justices - Ruth Bader Ginsburg, Stephen Breyer, Sonia Sotomayor and Elena Kagan - would have kept the injunctions in place. As is the court's custom in such orders, neither side gave reasons.
The courts were considering a policy developed by then-Secretary of Defense Jim Mattis, who issued a plan to bar from the military those who identify with a gender different from their birth gender and are seeking to transition. Mattis's plan makes exceptions for about 900 transgender individuals who are already serving openly and for others who say they will serve in accordance with their birth gender.
"As always, we treat all transgender persons with respect and dignity," said Air Force Lt. Col. Carla Gleason, a Pentagon spokeswoman, in an emailed statement. The policy "is NOT a ban on service by transgender persons. It is critical that DoD be permitted to implement personnel policies that it determines are necessary to ensure the most lethal and combat effective fighting force in the world."
Department of Justice spokeswoman Kerri Kupec praised the decision and said, "The Department of Defense has the authority to create and implement personnel policies it has determined are necessary to best defend our nation. Due to lower courts issuing nationwide injunctions, our military had been forced to maintain a prior policy that poses a risk to military effectiveness and lethality for over a year."
But Lambda Legal counsel Peter Renn said the policy is insulting to transgender troops.
"For more than 30 months, transgender troops have been serving our country openly with valor and distinction, but now the rug has been ripped out from under them, once again," he said.
But the fact that a majority of the court allowed the policy to go into effect shows that challengers of the policy face an uphill battle.
Trump surprised even his own military advisers in July 2017 when he announced via Twitter a sweeping ban on transgender people's military service. He cited what he viewed as "tremendous medical costs and disruption." The administration's order reversed President Barack Obama's policy of allowing transgender men and women to serve openly and receive funding for gender-reassignment surgery.
Attorneys for active-duty service members went to court to block the policy shift, which could subject current transgender service members to discharge and deny them certain medical care.
A Rand Corp. study completed for the Pentagon in 2016 found that 2,500 to 7,000 transgender men and women were serving among the 1.3 million troops on active duty, although Mattis questioned the study's accuracy.
While several lower courts have blocked the policy, the changes made by Mattis were persuasive to a panel of the U.S. Court of Appeals for the District of Columbia Circuit, which became the first appeals court to review the policy.
"The government took substantial steps to cure the procedural deficiencies" previously identified by a lower court, the panel said in a short order. "Although the Mattis Plan continues to bar many transgender persons from joining or serving in the military, the record indicates that the plan allows some transgender persons" previously barred to join and serve.
The policy is not a "blanket ban," the court concluded, because "not all transgender persons seek to transition to their preferred gender or have gender dysphoria."
The controversy over allowing transgender service members to serve openly has a long history.
The Obama administration opened the military to transgender service members in June 2016, focusing first on allowing those already in the service to remain and then on providing them medical care. In announcing the policy change, then-Defense Secretary Ashton B. Carter said the administration did not want "barriers unrelated to a person's qualification to serve" preventing the military from recruiting or retaining the best people available.
The policy approved said that "not later than July 1, 2017," the Pentagon would update its medical standards to include people who have a history of gender dysphoria, the medical term for wanting to transition. It added that the Pentagon would begin taking transgender recruits in July 2017 for the first time as long as their doctors certified that they had been mentally and emotionally stable over the previous 18 months.
Mattis delayed opening the military to transgender recruits on the eve of that deadline by another six months, citing a request from the Joint Chiefs of Staff for further study. In the meantime, the Pentagon would continue to treat transgender troops with dignity and respect, Mattis said in a memo. Advocates for transgender people decried the move, saying the issue already had been studied at length.
The situation was thrown into turmoil a few weeks later with Trump's tweet.
Marine Gen. Joseph Dunford Jr., the chairman of the Joint Chiefs of Staff, released a memo the following day effectively stopping the military from making changes until a new policy was adopted, and Mattis backed the move. Meanwhile, the president's ban was challenged in court.
Trump issued a presidential memorandum the following month that accused the Obama administration of allowing transgender military service without identifying a "sufficient basis" that doing so would not "hinder military effectiveness and lethality, disrupt unit cohesion, or tax military resources." He directed Mattis to have the Pentagon adopt a new ban similar to the military's former policy by March 23, 2018.
With legal battles still underway, Mattis wrote in a memo to the president that he was in favor of letting most transgender troops already in the military stay, so long as they have not undergone gender-reassignment surgery and are able to deploy across the world.
But Mattis' view on bringing in additional transgender people as recruits was more closely aligned with the president's.
Federal judges required the military to begin allowing transgender recruits beginning in January 2018, and the Pentagon has not stood in the way of those rulings. Instead, it provided policy guidance to recruiters to explain how to enlist transgender men and women and said those guidelines "shall remain in effect until expressly revoked."