From left, transgender military members Navy Lt. Cmdr. Blake Dremann, Army Capt. Alivia Stehlik, Army Capt. Jennifer Peace, Army Staff Sgt. Patricia King and Navy Petty Officer Third Class Akira Wyatt attend a House Armed Services Subcommittee on Military Personnel hearing in Washington. (Manuel Balce Ceneta/AP)

Mike Mullen, a retired U.S. Navy admiral, was chairman of the Joint Chiefs of Staff from 2007 to 2011.

The Defense Department announced plans last week to reinstate a ban on service by openly transgender Americans that, until now, has been blocked by multiple court rulings. This decision hurts our national security, deprives our ranks of much-needed talent and flies in the face of the values our military institution represents.

I should know. As chairman of the Joint Chiefs of Staff from 2007 to 2011, I advocated — and led our armed forces through — the repeal of “don’t ask, don’t tell,” a policy that similarly forbade gay and lesbian troops from serving openly.

We managed this transition carefully, not only with an eye toward data but also with a strong sense of how the policy might affect morale and mission accomplishment. A panel of military and civilian investigators conducted a comprehensive review of the facts on the ground, which found that there was no good rationale for the ban and that eliminating it posed a negligible risk to military effectiveness . We were willing to release the findings of that work and to defend it publicly.

I was troubled that our military had a policy forcing service members to lie about who they were as a condition of service. This, I felt, was a blow to their integrity, as well as to our military’s. If there were no cost for equal treatment and a high cost — in talent, careers and integrity — for discrimination, ending the ban was a simple choice. Subsequent research shows our military was stronger for it.

In 2015, a similar process took place around transgender service. The Pentagon created a working group consisting of military and civilian personnel representing all the services and the Joint Staff, and it also engaged the Rand Corp. to conduct an exhaustive study into the readiness implications of open service. The process confirmed what prior research and experience had told us : There is no valid medical or military rationale for banning openly transgender Americans from serving as their true selves, or from obtaining medically necessary health care. The department lifted its ban against transgender personnel in 2016.

The military’s experience with open transgender service over the past three years has only corroborated that conclusion. Despite concerns about financial costs, the price tag of providing care for transgender troops has been negligible , amounting to less than one-tenth of 1 percent of the military’s annual health-care budget. Despite worries about transgender service in austere environments, Pentagon data shows that nearly 400 people with gender dysphoria have successfully deployed to combat zones.

Several of these service members gave poignant testimony before Congress last month, displaying the kind of talent and bravery our military needs. Alivia Stehlik, for instance, a transgender U.S. Military Academy graduate, deployed to Afghanistan as a physical therapist, where she treated more than 1,700 patients. She told lawmakers that being honest about herself inspired fellow service members to be more honest about themselves. Her integrity bred more integrity, and instead of spiraling into denial and pretense, her unit enjoyed enhanced cohesion and morale.

Stehlik is one of a small cohort who will be grandfathered in under the new ban. But whatever rationale retains her for service ought to welcome any qualified transgender person. The new policy, which is based on the recommendations of a panel that then-Defense Secretary Jim Mattis commissioned, bars another Stehlik from joining the military. At a time when the military is missing its recruiting goals and spending hundreds of millions of dollars on enlistment bonuses and lowering standards to fill shortfalls, we should think twice about banning service by qualified transgender people for reasons that have nothing to do with ability.

Like “don’t ask, don’t tell,” the current ban presents itself as a neutral policy imposing narrow restrictions on a segment of the LGBT population instead of what it is: a cudgel broadly targeting a defining characteristic of the population. The new policy allows transgender people to serve only if they avoid being diagnosed with gender dysphoria and agree to serve in their birth gender.

The Pentagon is being too cute by half when it claims it is not banning transgender people from service. A policy that targets proxies of being transgender amounts to an effective ban. Worse, it could discourage people from seeking the psychological and medical help they may need, potentially leading — as the Rand Corp. study found — to more cases of substance abuse and suicide.

In war, it’s crucial to fight the next battle instead of the last. Likewise, we should be aiming to build the military of the future, not of the past. Discriminating against a group of proven patriots is no way to appeal to the next generation of fighters and serves only to place politics above readiness. Fortunately, the Pentagon has stated it is committed to reviewing the data on transgender service within two years. We must hope that, when it does, it is prepared to do so with a genuinely open mind and to do the right thing.