Spanish participation in the war would make life harder for the British in 1940-42, but it doesn't win the war for the Axis unless some other things change.
There is a window between June and September 1940 when the war appears to be over apart from negotiating the peace treaty. That's what made Mussolini join the war and if Franco had done the same he would soon regret. It is quite likely that he would also be dead by the end of 1945.
The main active contribution Spain can make to the war is to close the Strait of Gibraltar with the coast artillery they have in southern Spain. That means Malta can only be supplied from Alexandria and when that route is also cut off the island falls. That would probably be in the first half of 1942.
However, just as important is Spain's location. It would give the Germans valuable bases for the Battle of the Atlantic.
-The approaches to Cadiz and Ferrol were harder to patrol than the Biscay ports so it would be easier for Axis surface warships, U-boats and blockade runners to get in and out.
-The Fw200s would be able to fly a few hundred miles further west.
-The long-range U-boats operating in the South Atlantic and Indian Oceans would have their transit times cut by a few days.
-It would be harder for the RAF to bomb German heavy warships operating from Cadiz than Brest. Though there is the possibility of Pearl Harbour style air raids by the Royal Navy (and USN from 1942). Therefore the Germans would use Cadiz as a forward base and make Cartagena their facility for major repairs. Spain's Mediterranean coast would be impossible for the RN to attack with aircraft carriers before the end of 1942 and Bomber Command would have to fly over hundreds of miles of mainland Spain to reach it so the air defences would have plenty of warning.
Thus the German forces sink more WAllied merchant shipping, but not enough to alter the result of the war. If it was combined with the Germans having a stronger surface navy and a larger Maritime Luftwaffe that might be different. Possession of these bases might make Hitler accept the Kreigsmarine's request for resources to build more U-boats with, but what is Germany going to make less of to compensate? The Germans might be able to give the Spanish money and technical assistance so that more aircraft, surface warships and submarines can be built in Spain. However, that would not be enough to change the result of the war either.
Meanwhile the British occupy the Canary Islands in 1940.
The fall of Malta in the first half of 1942 is not early enough to help Rommel break through to the Suez Canal and even it he does events at the other end of the Mediterranean prevent its exploitation.
The WAllies still land in Morocco at the end of 1942. They occupy the Spanish Sahara and Spanish Morocco before pushing on to the border of Algeria and Tunis not much later than they reach it in the real world. They won't be able to send merchant shipping through the Strait of Gibraltar, but there is a railway that runs from Casablanca to Algiers and Tunis, which can be used to supply the WAllied land and air forces. Malta's surrender will make it easier for the Italians to supply the Axis forces in Tunisia and losses of Axis transport aircraft are going to be considerably reduced. However, that might be good for the WAllies in the longer term because Hitler and Mussolini might send more troops to Tunisia.
I think Tunisia would still be in WAllied hands by the middle of 1943 and the invasions of Sicily and mainland Italy would not be delayed. D-Day and the invasion of Southern France would still happen and at the same time.
The Balearics would be taken as a prelude to the invasion of southern France, if not earlier. Mainland Spain would be bypassed and left to "wither on the vine". Franco would start surrender negotiations himself or there would be a coup like the one that deposed Mussolini. Spain would change sides between early 1943 or the middle of 1944.