Capitalism creates poverty and misery and exports it abroad: Immigration is often caused by Imperialism, the highest stage of Capitalism. People from third world countries find themselves unable to live a proper life due to the shackles of Western Imperialism and decide to move to the Imperial Core, in search of a better life. They are then exploited as a cheap labor force and used as scapegoats by the same people that exploit them to justify all the issues and contradictions of the Capitalist system.
This is where the "immigrants are taking over our jobs" narrative comes from.