Many of the immigration restrictions in america started around the time the first welfare programs were introduced. Before that, it was a bit of a free for all. I don't know if the same pattern holds anywhere else, but I'm suspicious that might not be a coincidence.