America was very much against immigrants between about 1925 and 1965. If you look at the history of the US they needed immigrants to settle the land, before their expansion westward they were quite against immigration.
And still despite immigration reforms and national origin quotas, USA still accepted by far more immigrants during this time period than any other country.
The railroad barron needed cheap labour and didn't give a flying fuck about the KKK clowns marching in Washington.
The elites always want cheaper labor, while the existing domestic workforce usually opposes such measures (as it obviously devalues their labor)