My theory is that the Papacy sides with France to have the HRE/Habsburgs out of Italy if they get too powerful and Spain takes much of the Papal States as punishment and to ensure the pope doesn’t have any sort of leverage against Spain’s Italian holdings ever again.