The thing is, the people are ultimately selfish creatures. Social structures ultimately exist to benefit their members. When a social structure (such as the EU) stops to benefit its members (or is perceived by a majority of them as having done so), it falls apart into entities that fulfill that condition, or at least seem to. As far as most people are concerned, the refugees are not "us". If the government starts prioritizing "them" (or itself) over "us", then there is no point in tolerating the government any more. Ultimately, this boils down to the old paradigm: Knights defend peasants, peasants feed knights. And if a knight spends his whole day rescuing princesses instead of chasing bandits off his village, he'll soon find himself doing that on an empty stomach. Both sides attempted, over the ages, to find a "better" (for them) system, but all that knights have achieved was to intimidate peasants into feeding them instead of doing them favors (later they found it wasn't such a good idea), while peasants figured (a bit later) they could pick knights from among themselves (they are yet to find it wasn't such a good idea, but we're slowly starting to see just that happen...). Ultimately, every government in history boiled down to that, "human rights" and "humane behavior" are recent inventions by no means inherent in how the society works. It is rather logical they're one of the first things to go down the drain when a crisis strikes.
Ultimately, when faced with choice between acting humane and acting selfish, most people will choose the latter. They only chose the former if it benefits them (say, due to social pressure enforcing humane behavior). It is up to the government to protect their people without needless cruelty to those that they protect them from. Nationalism will exist as long as nations themselves do, it's up to national leaders to prevent it from turning ugly.
sure, forcefully deport all illegal migrant farm workers, and then see how well you do when millions of tons' worth of crops rot on the vine, and food prices skyrocket. And yep, the fact that Japan's barely having any kids is no problem whatsoever, right?
The thing is, US produced food prices are too low and they actually should increase. Cost of any domestically produced product should be high enough to cover legal labour requirements to create that product, including respecting minimum wage laws and the cost of having legal workforce. So let the crops rot, and maybe next year US food producers will adapt to pay enough money to employees to produce the food without the need to import a new semi-permanent underclass into the economy and thus ****ing the country over for profits.
The thing is, there's a good chance that in this case, US food would be so expensive that people wouldn't be able to afford it. Food is sold at the price that people can buy it at. This is a basic law of the market. In an unregulated capitalism, wages of the workers would drop until food is affordable. If a minimum wage is enforced, this would artificially dictate a minimum food price, which could be too high for it to be profitable (because people working at this minimum wage couldn't afford it). That probably wouldn't lead to a famine, but to increased import of foreign food (since it's not something people can go without), probably from a country that does not have such high standards as the US. Ultimately, the only difference is where the slaves are. Which is better, having people toiling in sweatshops for a few table scraps per day in the US, or having people toiling in sweatshops for a few table scraps per day in China? The only difference would be that foreign food would have added import costs, so it'd have to be made even
cheaper than if it was made locally.
Also, it's not a "new" semi-permanent underclass, at least in the US. This underclass has a long tradition in the US. It being semi-permanent is a good thing, since it means people have a chance of getting out of it. In the US economic situation, this is something that works. Not only that, it's deeply entrenched in the US economic ecosystem. Breaking it would be a disaster, as Alabama example has shown.