Or: Shouldn't immigration be good for capital?
I know they'd prefer for migrants to stay somewhere where their labor time is cheaper to make better use of unequal exchange, but how is it better to spend so many resources on turning away refugees and immigrants that are desperate to work for cheap, than to simply let them get exploited? What are the forces at play that make capitalists invest in border security so much? Is it simply to keep an implicit threat on the existing undocumented immigrant population to make them more precarious and more exploitable?
I would say the two reasons are stupidity and strategic.
Immigration is good to keep wages and prices down (if you’re lucky, prices can stay or even increase). However, you must also placate your population which will resent the lost of jobs and wages. It’s why conservative media and politicians rile up their base about migrants stealing jobs and other things while almost exclusively hiring them for back breaking jobs. It’s also why liberals champion immigration while being slow to give them meaningful rights and throwing them to the dogs when the right starts tugging on the overton window. This is the strategic reason for anti immigration. Managing the size of the reserve army of labor is important. Too much unemployment, homelessness, and too many migrants = unstable and unproductive society. Just the right amount = people accept terrible conditions to get by while you profit greatly.
Then there are people who cannot see the big picture and want to kill minorities and migrants and so on because they think it’ll usher in a pure society. Think of the Nazis who wanted to kill virtually all Jews and Slavs, save for a small amount to keep as slaves. If they were competent, they would’ve enslaved the people they hated in order to build their empire. Genocide is a stupid goal for fascism as it allocates a ton of resources into the killing labor sources rather than using them to develop your nation. Now that the undesirables are gone, you have to dig into your supposedly pure society to create new undesirables to exploit.