Why would a flight from Frankfurt to Madrid fly over London?
I can't be completely sure but the most likely reason is a planned strike by ATC in south-east France. It was planned from the 30th of June to the 1st or 2nd (depending on the source) of July, meaning that ATC services would be unavailable or at least seriously reduced in that area, presumably with knock-on effects in other parts of the country. Some airlines had cancelled flights completely although in the end it looks like the strike was called off. 

Strikes are notoriously common in France (there's even a website dedicated to tracking them all) and especially in the summer, so an airline might just plan to avoid French airspace altogether to avoid the uncertainty. Of course that costs more money, as you said, but a missed connection to Chile and stranded passengers in Madrid would also cost money.