The problem isn't immigrants, it's the countries that make the situation worse and force people to immigrate. This happens both from people moving from underdeveloped countries to developed countries, and vice versa.
The difference in these two cases is that underdeveloped countries tend to be much more respectful of immigrants and don't blame them for their problems.