How many illegal migrants are actually refugees? The U.S. and European Union have rigorous systems for vetting refugees. The doors to these nations are not completely closed to individuals who are fleeing political or social persecution. The key word is "individuals".
Masses of people running from war, famine or economic deprivation cannot be properly vetted. Borders around peaceful nations are there for a reason. A massive influx of uneducated and disorderly people can bring down the standard of living of a whole society. Turkey is unwinding under the weight of Syrian migration. Jordan has been stressed for decades by Palestinian migration. Gang violence in the U.S. is associated with Mexican and Central American migration.
Governments are not dealing well with migration. The reasons are simple. Governments have ignored climate change and overpopulation across the board. Governments in rich countries have bowed to individual greed over institutional international generosity. The concentration of wealth in the top 1% of the world's population is staggering. Tokenism by Bill and Melinda Gates will not balance out the deprivation of the many by the greed of the few in a world where planned parenthood, women's rights and environmentalism are widely unestablished. Those with great wealth and power are still concerning themselves with protecting arcane religions rather than the survival of their own species.
Migration in earlier human history is described in histories as invasion. It is not new. Warring tribalism most likely grew out of competition for environmental resources by large family groups when their populations outgrew their immediate environments. The current human population growth with its environmental impact will inevitably lead to invasion, war and great suffering. Carbon in the atmosphere is at its highest in 5 million years. There were no known humans (homo sapiens) on the planet 5 million years ago. Homo sapiens is thought to be a species which evolved about 2 million years ago. Where will human beings flee when the whole planet is hostile to the species?