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?
You see this tension with a lot of companies that exploit immigrant labor actually, corporations understand that they need readily available workers. While there are benefits to having them scared to seek legal protections and not subject to normal labor laws they still need to be in the country to be exploited.
But the reactionary project also is expressing itself to the ground level reactionary through xenophobic and racist rhetoric to mobilize them. The more the base believes immigrants to be the source of their problems the stronger the contradiction becomes, but a distraction of some sort is necessary if you're going to get enough people on board and not blaming you, the C-suite, for their problems.
Ideally they would just direct policy themselves without the need for theatre. But so long as they have to get people into positions using 'democratic' processes they need buy in. So for now they accept fewer laborers and just do their best to make it easy to exploit the ones that make it in to further extremes.
Bonus points if you're able to distribute public funds into private hands in the process by having the militarized border become a private enterprise with corporate prisons, and of course shareholders love providing ICE with the equipment they use.