Keeping refugees is migrant enclaves cost money yes, but it is not the entire foreign population, which is a massive difference. Also, housing can be accomplished much cheaper, healthy foodstuffs can be effectively delivered and distributed in bulk. Compared to right now where taking care of a migrant for a day is already more expensive than a day in a holiday home and a meal in a cheap restaurant.
Your solution is completely unrealistic, how can Muslims be integrated in a western society? Several western countries have tried, all have failed dramatically because not only conflicts Islamic culture with western culture, the new citizens have actively rejected assimilation. Surely there are individuals who can transcend their background and become productive members of society, but as a whole they will be a strong net-negative. Sure, the costs of integrating them in the short term are not that high, just a few billion euros a year, but the costs of trying to integrate them will be astronomical in the long run. It takes many, many productive citizens to compensate for the costs of one individual trying to increase his welfare package with a life of crime, or worse, trying to actively destroy society.
Simply put, immigrants from the seventies are still 'perpetual wards of the state', with one difference is that there are many more of them. It is cheaper to just give them stuff than have them rob people for it.
And making the middle east save certainly isn't easy. But problems in Iraq and Syria and other middle eastern countries have deteriorated precisely because strong leadership has been overthrown. New powerful secular dictatorship is required there for things to improve.