The law works differently at the border, especially for non-citizens. Tourists don't have any legal right to get in. You may argue that the guards should be kinder and I would agree.
The historical examples you mention involve racism and slavery that were terrible but also the global standard at the time.
The Patriot Act is scary, but it doesn't seem much better elsewhere in the Anglosphere or in Europe. Say something impolitic loud enough and you'll get in trouble anywhere.
Here's hoping individual freedoms win in the end.