It was present in France, probably in a British army camp first, but...it probably came from China. The French had imported large numbers of Chinese laborers to help with the farm work in this rural part of France, since all of the able bodied French men had been called up.
It went through the British and US military camps and they brought it back to their respective countries. It was called Spanish because while it was first detected in France, those countries were under military censorship and it couldnt be reported. Spain was neutral and did not have censorship, so when it got there, reporters could report it.
I don’t get the attempts to rewrite the origin as being the U.S.
Many Chinese laborers were shipped to France via Canada during WW1.