It’s really absurd on so many levels.
Beyond the obvious mentioned by others, a lot of these people are skilled in specific fields that are particularly hard to find replacements for. Like, the military has serious issues with retention of specialists (I mean the general term, not the rank) as of late, so to be intentionally kicking out a significant cohort of specialists on arbitrary grounds is just going to make the issue worse.
Not to mention that they’re setting an example that this could happen to any number of potentially targeted groups, who will probably avoid joining, or committing to a long term career if they do join, shrinking the pool of applicants for specialist positions even further.
It’s cutting off your nose to spite your face.