In my country, and I assume in the US, immigrants are useful to the bourgeoisie as highly-vulnerable and highly-exploitable labor. As many say, they do the hard and dirty jobs which other people don't want to do, they can be coerced with threats of deportation. And with the US Republican Party's apparent attempts to reduce offshoring and bring production back onshore, surely powerful sections of the bourgeoisie have an interest in lowering labor costs to compensate.
A popular answer from the mainstream is to simply point to White nationalism and other bigotry. Another answer is that illegal immigrants acts as a scapegoat and a way for their party to signal to citizens that they're doing something to solve their problems. And while I think these are reasonable and plausible suggestions, I want to explore other options before assuming a simple cultural explanation. For example, liberal media tends to frame Middle-Eastern conflict with the Zionist Regime (and even Western support for the regime) as religious conflict or even a racial conflict, rather than colonial imperialism.
It's about making the lives of undocumented migrant workers more precarious, giving their bosses more leverage (do as I say or I'll turn you in) which in turn gives the bourgeoisie more leverage over the working classes. There are the culture war aspects of it too — it's always useful to have an Other to scapegoat — but the policy goal is rational / driven by 'natural' incentives.