That law can be repealed if Europeans aren't vigilant; nothing makes the EU naturally immune to right-wing, pro-corporate swings.
One of the reasons the UK left EU because it was not allowed to have different laws for EU immigrants and locals - for benefits for example.
Europe choose values over money. They - Merkel - may not be the best people in the world but some moves are very commendable.