The problem is demonisation of foreigners by certain elements of the media and certain politicians and certain former presidents. 'Foreigners' aren't a problem. Treatment of foreigners is.
One major problematic outcome of immigration, legal or illegal, is that it is often the young and skilled who are able to escape their nation of origin, leading to a brain drain in that country as they move to richer countries with better opportunities, such as the US.