It's actually a manifestation of the US security state. Foreigners or foreign-looking people are just the first victims. Rest assured, before long everyone in the country will be suspect.
Differential treatment of foreigners is hardly a unique US phenomena. And don't interpret that as my support for any particular US border control or security policy.