Looking at the time zone map on Wikipedia we can see that countries such as France and Spain technically should have a time zone of UTC+0. Wikipedia says:

France previously used GMT, but was switched to CET (Central European
Time) during the German occupation of the country during World War II
and did not switch back after the war.[15] Similarly, prior to World
War II, the Netherlands observed "Amsterdam Time", which was twenty
minutes ahead of Greenwich Mean Time. They were obliged to follow
German time during the war, and kept it thereafter

But Spain was not occupied by Germany… How did it happen that their time zone is UTC+1 then?

2 Answers
2

Spain changed the time zone in 1940 from GMT to GMT+1, Franco thought that it would be a good idea to have same time than nazi Germany and fascist Italy (his political allies), after Germany occupied France. The United Kingdom modified the time zone too, but return back in 1945.

In the 80s, the PSOE (political party at government) institutionalized the custom of adding another hour in summer, so the time gap is more than two hours, for more than six months every year.

In October 2012, in the VII National Congress for Rationalise Spanish Time Zones (remember that there are two time zones in Spain, one for the peninsule and other for Canary Island), Nuria Chinchilla, has proposed to return to GMT.

Also it is worth to mention that Galicia ( North west of Spain ) solar time zone is GMT-1 being the difference 3 hours with the official hour time during a long period of the year
–
EnxebreJun 21 at 12:47

Primarily for convenience of trade and communications across national borders. As the countries of Western Europe have become ever more closely linked, it makes life easier if people can agree on what time it is.

The initial standardisation of times, in Great Britain at least, came with the railway - Bristol time was 11 minutes different to London, based on the time of sunrise, sunset etc, and this played merry hell with timetabling.
As communication and transport have improved, it has become important to co-ordinate times across a wider area. Even up to the 1930s few people would drive from Spain to France, and transport links were fairly poor.
Having said that, I'm not sure why the same argument would not lead Portugal to join the movement towards GMT + 1, so it clearly isn't an all-powerful line of reasoning.

Portugal is a traditional ally of Great Britain (in addtion to being even further west than Spain), so perhaps the trade argument actually worked in favor of GMT for them.
–
T.E.D.♦Sep 17 '12 at 14:51

@T.E.D I would expand that to say that Portugal didn't just happen to be friendly with the UK, but had an economy that generally looked to the sea rather than to Spain. Examples of this would be the Port trade and the spice trade (this one having little to do with GB, rather more to do with the Portuguese naval empire).
–
Nathan CooperFeb 26 '13 at 16:09