And it would be absurd if they could not.
Also, in some cases, employers should be able to discriminate, it's totally different to hire someone on an n-month visa vs full time.
Granted, it's different if they are Green Card.
It's also perfectly normal to want to hire locals, if it can be done on a national basis, then I think for some roles, state ought to be fine as well. If state governments had a state preference for in-state nationals, that would be fine, for example.
The issue here is by far and away mostly one of transparency and efficiency - the rules should be clear and the bureaucracy should just function normally.
The fact that anything takes months, or that you need lawyers etc is a sign of dysfunction.
It should be about as complicated as getting a prescription. 'One trip to an office and done'.
For those seemingly not believing this, read: [1]https://www.avvo.com/legal-answers/can-a-company-refuse-to-c...
So it's a decision between violating the law and acting unethically?
It's totally unreasonable to suggest that companies should have to hire random people from nation xyz only to have to sponsor their impossible work visas.
And I say this as someone who was on work status for a very long time.
Clarity, consistency, simplicity, predictability - this is what people want.
Because 'discriminating against people of other ethnicities' is kind of as old as time, the issue triggers our empathy radar a bit, which is reasonable, but in reality what would be 'the most fair to everyone' is just clear rules, and very light but important anti-discrimination aka can't discriminate on age, race, gender religion aka the basics.