I don't think needing workers is why immigrants were brought to Europe. That seems like an excuse government gives but it's contradictory that immigrants from other cultures were brought in by the government to work but then also have higher unemployment and use more welfare, citation in here
https://en.wikipedia.org/wiki/Islam_in_France I guess the government could have just got it badly wrong. In theory, worker shortages would lead to higher wages and government efforts to stabilize birth rates like what Japan is trying to do.
I think the actual reason is something like a vast western empire promoting diversity as a good thing for your country. The 2015 immigrant surge into Europe was not because EU countries needed workers. Similarly, countries that have tried to block immigration like Poland and Hungary are accused of being far right fascists and uncooperative and NGOs from the US come after you. The general belief seems to be that too many white people is a bad thing and backwards.