The Republican side wins the Spanish Civil War under the guiding hand of the PCE, who by the end, have supressed the liberals and the anarchists.
I doubt that's going to work unless you really ramp up Soviet aid by orders of magnitude, which I don't see as even infrastructurally feasible. I don't think the Republicans couldn't have won, but the PCE alone couldn't have pulled it off - look at how Republican infights weakened the left IOTL already. Escalating that is only going to make matters worse.
I can see, at some point, a sort of coup/general strike/revolution in which the PCE marginalises its former allies after the Spanish Civil War we know (only with a Republican victory), but that would cause a second civil war, and that one won't have ended in 1941.
Now if your question is, what if a Frente Popular Spain beats back Franco et al., and the Communists emerge as the most powerful political force among others from all of this, how would they interact with WW2, then I suppose the way they view their situation isn't likely to change all of a sudden on June 22nd, 1941. Republican Spain would have clearly leaned anti-Axis, and what would have held them back from directly joining the Allies is probably that the country had just gone through a horrible bloodbath already and that Britain and France had stabbed them in the back, and that their military potential to withstand an Axis attack is not ideal, either. None of that changes when Hitler invades the Soviet Union. There are many ways in which this can go: Spain can join the Allies as early as 1939, which could mean Axis invasions not only of France but also of Spain in 1940. Or Spain can join the Allies in 1941, as you suggested, although I wouldn't think orders from Moscow would be decisive here, rather that Hitler is now quite distracted and has clearly bitten off more than he can chew, so joining now looks both less dangerous and more profitable. Or Spain can join late, as late as 1943, opening up a new front against the Germans in the West, which would mean the invasion of the Normandy is not necessarily the only landing option.