From my immigration law reading:
For a fairly long time, the United States had a policy of entirely open borders, and didn’t regulate immigration much at all. When the first exclusion law was passed, Congress chose to bar two groups: Prostitutes and vagabonds.
This was even as open borders were applauded for their humanitarian and liberal values, serving, as George Washington urged, to make America an “asylum” for the “oppressed and persecuted of all Nations and Religions.” Apparently, “prostitutes and vagabonds” never need a benevolent nation to shelter them.
One thing I’ve learned in law school: Oppression never gets old. And the same bottom-of-the-barrel groups just keep getting hit.