This is illegal under IRCA unless another law or government contract mandates it. [1] If every single role at your company requires a Secret clearance, then I question how separate “your part of the company” really is from the part that makes weapons.
I believe there is some protection against discriminating against greencards, but not visas
Some state or local laws offer additional protections beyond federal law, including NYC for all immigration statuses, except as required or allowed by other applicable laws. (So, for example, NYC doesn’t pretend that companies have to hire people who don’t already have employment authorization.)
I’m guessing the contracts that make paper clips don’t need those stringent requirements, but the ones that make sensitive comms equipment do.
Some places like NYC offer legal protections in this area to all categories of immigration status, of course within what applicable federal and state law requires and allows. Federal law allows preferring citizens over equally equalities noncitizens, requiring employment authorization to already exist, and complying with any specific legal requirements for restricting certain jobs to citizens. NYC law respects all of this. But overall NYC is totally allowed to, and does, add protections beyond federal law.
"Secret" classification is really mild, about 5 million people have one.
>The law prohibits employers from hiring only U.S. citizens or lawful permanent residents unless required to do so by law, regulation or government contract.
At these workplaces it will be a combination of all 3 of law, regulation, and government contract.
Edit: Ah I see you are not disagreeing with what I said at all. Apologies, I cannot count the number of times I have seen in reddit and here, where people confuse ITAR with clearance.