No matter who won the Civil War Spain was going to be trashed when the war ended in 1939. If the "Republic" wins the question is which "Republic" is it? A democratic one, an anarcho-syndicalist one, a socialist one, a communist one? IMHO a victorious "Republic" is going to spend some time after the end of the civil war sorting out exactly who is going to rule Spain. To the extent Germany had a dog in the fight their major gain was practical experience, but some of the "lessons" were false, like lightly armed bombers like the He-111 could range at will. Raids on London were not like raids on Guernica (or Warsaw or Rotterdam without air defenses).
In theory a Stalinist-Communist Spain might be "ordered" by Stalin to attack across the Pyrenees when BARBAROSSA happens, but unless the government in Madrid has a death wish that is not happening. The "Spanish question" did stir the political pot in France, but an actual civil war in France was not in the cards no matter who won.
IMHO net result on WWII for Spain being under "Republican" control vice Franco, is not so much. Changes yes, but otherwise not much.