Why did American nativist groups oppose free, unrestricted immigration in the late 19th and early 20th centuries?
One of the main reasons why anti-immigrant feelings rose sharply during this time period is because from 1880 to about 1920, the US experienced a gigantic wave of immigrants. More than ten million people moved to the US in that time, and we're talking in a country where there were still fewer than 100 million people in the entire country. In other words, the backlash was a natural reaction of society to an influx of people speaking unfamiliar languages and different religions. This is not the first (nor last) time this has happened in history. This fear of foreigners is called xenophobia.
Americans also held long standing anti-Catholic sentiments dating back to the colonial period, and when large numbers of Catholic immigrants, the Irish and Italians especially, increased xenophobia was the result.
You can also say that anti-immigrant feelings in the late 19th and early 20th centuries was motivated by much the same things as motivates the anti-immigration movement today.