President Donald Trump evidently thinks barring transgender Americans from service solely on the basis of their gender orientation is a plus for the U.S. military. We think the effect of the ban he announced Wednesday via Twitter will be just the opposite.

One of the reasons that public respect for the U.S. armed forces has soared in the modern era is the perception that today’s military is a genuine meritocracy — an institution in which individuals can rise on the basis of their qualifications and performance, not gender, color or status.

Trump’s transgender ban undercuts that perception. It sends the wrong signal about the values that the nation’s military embodies — particularly to the young Americans whose willingness to serve is crucial to maintaining military strength.

Opening military doors to service by transgender citizens is relatively recent; it happened during the latter months of the Obama administration. Only a few thousand of the 1.3 million Americans in uniform are transgender, a Rand Corporation study said last year. Full implementation of that change was recently delayed for six months, moving its deadline to December. It says much about Trump’s tweet-from-the-hip governing style that the Pentagon appeared to be caught off-guard by the president’s early-morning announcement of a policy reversal.

Also caught off-guard will be any voters who swallowed candidate Trump’s assurances that he would be a defender of LGBTQ rights. Banning transgender Americans from military service may appeal to some elements of the Republican president’s political base. But it’s also likely to harden resistance to Trump’s presidency among those who hold that no group of Americans should be treated as second-class citizens by their own government solely because of who they are.

Presidents since Harry Truman — who banned racial discrimination in the military and federal government employment 69 years ago Wednesday — have sought to open wider the military’s doors to service by any qualified citizen. Closing those doors to transgender Americans runs counter to that tide of history. We’ll be cheering for the members of Congress — hopefully including Minnesotans in both parties — who seek to reverse Trump’s ban.