No one wanted war at that stage, but...
In 1939, the allies were decided to stop Hitler at last. They didn't care if Spain was ruled by a fascist dictator, as long as he was not allying with Germany. So to spread the SCW, the way is make the republicans more succesfull, the german involvement more serious, and Franco -better still, some other leader- decisively pro-german.
Let's say the republicans have a decent coordination in the Brunete ofensive in 1937, they split in two the nationalist's territory and began winning the war. Hitler sends more troops and planes, and demands in turn that Spain sides with the Axis, or at least military bases near Gibraltar and near the french border. UK and France could not tolerate that. They enforce a blockade of german ships. A german destroyer gets sunk...
But probably Hitler would back off, Spain was not as important as Poland for him.