Most governments have become (or perhaps they always were) a lot like publicly-traded corporations - looking for short-term gains only. Next quarterly report, next election, etc. Not looking at what happens in 50+ years. Mostly it's our own fault for electing them based on the populist-idea-of-the-day and not on what the country would look like for our grandchildren.
Amazingly it's happening not only in Europe but in the US as well, despite it being a largely successful example of a nation of immigrants (some sketchy bits of history along the way of course but still). I think those few countries that are more open to immigration will benefit in the long term at the cost of some pain in the short-to-medium term but it's an impossible idea to sell to the general public.
Having said that, taking on all refugees is more complicated than regular immigration when e.g. the host country would typically pick and choose by setting requirements for age, education, etc. And there is also the fear of encouraging even more migration by making it easier to move to wealthy countries.
In the age of news being 24/7 and always BREAKING NEWS, politicans have to ensure that everytime their consituents see them in the news the optics of what their talking about must be good.
Planning for the future and reigning in on debt is not something that people care about. They want swift change that is far reaching and fixes all their problems. They love people who can talk the talk, but they never get anyone into office who truly cares about them.
Short and medium term immigration does truly hurt some nations who are already facing issues in regards to wage increase issues (as more supply into the labor market is going to bring wages down) and then there's some thoughts about the safety net programs and if they're allowed to be utilized by immigrants (that's a country to country issue)
But long term, yes, immigration is good. Most people don't really look at the long term though, they're just looking at if they can pay their own bills. Much easier to sell people a dream then a society that'll work in the long term, lol.