There are exceptions to everything. But only native-born US citizens are eligible for some jobs, e.g. in the military. Other countries may be even more particular and require your parents to be natives too. This is not discrimination but plain old common sense. What foreigner or foreign-adjacent person can really be trusted? If there is an exception to be made, the trust extended must be minimal.
> But only native-born US citizens are eligible for some jobs, e.g. in the military.
There are exactly two jobs where that is required, and only one is kind-of in the military, in that it is legally the apex of all military chains of command.
(There are other security-related, especially in the military, jobs where actual or potential dual citizens, the latter more commonly being an issue when people have foreign born parents, may be required to renounce any other citizenship than American.)
It is absolutely discrimination, but legal (and legally-mandatory) discrimination. That it may be “common sense” does not change that it is, absolutely, discrimination.
I think it's de facto required to be a US citizen (and preferably by birth) in more jobs than you think. It makes lots of sense. We have had scientists come from other countries to infiltrate our nuclear program, and we may not have even caught them all. This type of espionage is expected, and it is righteous to stop it. "Discrimination" or not, it is entirely reasonable for nationality and background to rule people out for any nationally sensitive job. I don't think you can find any country outside the West where the legitimacy of this criterion is questioned on the basis of fairness.