Migration laws started to be enforced shortly following the Civil War as part of an increasing push for human rights. Perhaps in one way yet another embodiment of the never ending trend of unforeseen consequences. For instance one frequent happening in the US of that time, that still happens around the world today, is that foreign workers would be promised free transport to a great stateside job in exchange for a cut of wages over a period of time. What that often translates to, then and now, is labor slavery for men and sex slavery for women upon arrival.

The first migration act, to my knowledge, is the Page Act in 1875 [1]. It prohibited the import of people for labor without their free and voluntary consent, and gave the government the power to restrict "undesirable" migrants. In this case, "undesirable" was effectively determined to mean Chinese women, whom were disproportionately involved in prostitution and concubinage for reasons the Wiki gets into. Shortly thereafter we'd get our first broad immigration law which excluded felons, people with various contagious diseases, convicts, those who did not directly pay for their own passage (to avoid the above issues), polygamists, and so on.

We effectively enacted labor laws to help enforce human rights, and that was not just a pretext. It remains, to this day, difficult to enforce laws against human trafficking and protect the victims of such. Now imagine this back in the 19th century! In modern times we've also changed a lot that's made migration a much more complex issue. Two very big issues:

-----

1) In times past there were negligible to no social programs. If you didn't earn enough money to feed yourself, you'd starve. Today we of course do not let that happen, but that changes one big thing. It creates a social responsibility for each person that comes to the country, which in turn drives a motivation to ensure a certain 'quality' of migrant, which may be unfair. For instance it's trivial to migrate to the US if you have money. On the other hand somebody who genuinely wants to move here and work and be a productive member of society, but has no resources, is going to face difficulties migrating.

2) Transportation used to be extremely expensive. Now it's cheap. Imagine if a place like Finland started a meaningful basic income program available to any resident (and not just citizens), tomorrow. By next week they'd see their population swell with millions of migrants to the point that their nation would be forced into complete insolvency destroying their program (and country) in the process. In times past traveling between continents had absolutely enormous barriers to entry. This meant far fewer people did it which, in turn, kept supply low and demand high. Now there are near 0 barriers to entry (beyond local migration controls) for migration.

-----

Migration, for a mix of reasons - many of them fully well intentioned, has just become much more complex. And anyhow looking back at history, I don't think it's any specific group. The Irish, rolling with your example, were not just openly accepted. There was substantial discrimination and other issues between Protestants (majority of Americans at the time) and Catholics (majority of Irish/German migrants). For instance JFK being a Catholic was a very big deal, and that was in 1960! And there was also of course the stereotype of a drunken, violent, criminally inclined Irishman. 'NINA' = No Irish Need Apply signs were commonplace. There were also things such as the "Know Nothing" movement [2] which was geared largely against Irish and German migrants. But as they rose above the stereotypes entirely of their own volition, and culturally integrated in general, all of this resistance faded over the decades.

[1] - https://en.wikipedia.org/wiki/Page_Act_of_1875

[2] - https://en.wikipedia.org/wiki/Know_Nothing