I understand that all three languages are Romance languages, but given that Spain is much closer to France than Italy, I would expect Spanish and French to be closer to each other than Spanish and Italian.
This is probably better suited to /r/Asklinguistics but while we're at it let me throw in a couple of points:
a. While all Romance languages are quite 'close' to each other and the whole Romance-speaking area may be viewed as a dialect continuum, French is the most innovative/least conservative Romance language by a very wide margin. So any two (Western) Romance languages that are not French will always be 'closer' to each other than to French.
b. Speaking as an historian, there's a lot of missing links here as there were/are a lot of Romance languages spoken across what is now Spain, France and Italy and these were/are indeed 'closer' to their neighbours. Standard French, Spanish and Italian are just three of them and neither developed anywhere close to the border so it is sort of irrelevant which country is closer to which other country.
Standard French descends from a Romance language variety that was spoken north of the Loire river, very far from the Spanish or Italian border. The vernacular language in the South of France, on the actual borders, was Occitan, a language very close to Catalan - the two were basically a single pluricentric language up to the 1200s.
Standard Spanish (aka Castilian Spanish) descends from a language variety that developed in the West of the peninsula, nowhere near the Pyrenees and the French border.
Standard Italian stems from the Tuscan language of Florence. The local vernaculars on the French border, for example, are varieties of either Franco-Provençal in the north (spoken on both sides of the border) or of Occitan in the south.
So if your underlying assumption is that Romance language varieties should transition into each other based on geographic proximity, you are not exactly wrong. But there are a lot more language varieties in these three countries and neither of the three standard languages are those that do the actual transitioning.