Spain managed to stay out of WWII because neither side could force it to join them. Spain was also relatively safe from invasion if it stayed neutral. Therefore, it did not join the war.
Spain's government was sympathetic to the Axis and Germany did want Spanish support. But Spain was able to put Hitler off. It asked for more aid in exchange for entering the war than Hitler could possibly provide.
When this happened, Hitler had no way to force Spain into the war. The Allies were not going to attack Spain and open up yet another front in the war. So Spain had no incentive to join Hitler.
Spain might have liked an Axis victory, but it was too devastated from its recent civil war to be able to join the war. Once Franco made that decision, there was no way that the Germans could force him to participate officially in the war.