

I don’t know if there was a big shift. Let’s look at the data: https://www.statista.com/statistics/454775/number-of-illegal-entries-between-bcps-to-the-eu/
The reaction to 2015 wave of immigrants was mixed. While some less affected countries were trying to welcome them most were directly opposing any EU-wide migration policies, building walls and refugee camps. After that the issue got more attention and as the number of illegal border coring increased countries started rolling out stricter enforcement.
EU never had the sort of “open border” policy US had where it would rely on illegal migrants to do low paid jobs. It was relying more on legal migration from ex colonies (Africa for France, South America and Morocco for Spain, South Asia for UK) or guest worker programs (Turkey-Germany) to bring in work force. The illegal border crossing were generally seen as an issue. I don’t think the perspective changed as much as the reaction is getting stronger in response to changing trends and in preparation for future migrations waves.
It is because most people were brainwashed into voting against their own best interest.