Quick conclusions are often drawn about the Spanish political position during World War II: Spain was a friend of the fascist powers, Germany and Italy, and as such it was «fascist». So widespread is this statement that I believe Spain's diplomatic stance in the early years of the greatest conflict in history deserves greater contextualization and elaboration.
Well known is the poor geopolitical situation of Spain at the end of the 19th century, left with only a few colonial domains in Africa. The imperial dream had faded and only intervention in Spanish Morocco seemed to save national prestige, especially for the Army. One of its components would be crucial in shaping the history of Spain in the 20th century: Francisco Franco. Catholic and conservative, he had forged himself in Africa with a distinguished military career that earned him, along with his opportunism during the difficult years of the civil war, to rise as the foremost political figure in Spain.
After the end of this conflict in 1939, the victorious Francoist regime had sealed a close friendship with the fascist powers as a consequence of their direct involvement in the war and ideological similarities with sectors of the Francoism. From then on the destiny and survival of these nations would be united, sharing thus the final goal of a reordering of Europe that rejected liberal democracies and communism, and thereby elevating themselves to the position they historically should have occupied according to their exalted patriotic criteria (Tusell and Queipo de Llano, 1985, pp 28-31).
Special would be the relationship it maintained with Mussolini's Italy, both due to the admiration of Falangist sectors for the fascist model —which Italians wanted to replicate in Spain— and because of the debt owed to this. The reality was that Il Duce sought to establish a paternalistic relationship over Spain to subordinate it to its interests; which aimed ultimately at both becoming North African powers (Tusell and Queipo de Llano, 1985, pp. 10-22).

So palpable was this diplomatic linkage that, in the first months of the world conflict, both nations declared neutrality at its outset —under German interests— not desired, as they expected it to extend temporally and territorially beyond Poland (Preston, 2002, pp. 429). For Spain, moreover, the German-Soviet pact, which allowed for communist expansion in the heart of Europe, meant a greater rapprochement with the Italians, an event that was always a concern for the Germans (Tusell and Queipo de Llano, 1985, pp. 79-91).
In this foreign policy of increasing subordination to Italy played a fundamental role the Minister of the Interior, Serrano Suner, Franco's brother-in-law and great figure of Falangism in these early years of war due to his growing political influence. He represented that revolutionary right which sought to consolidate fascistization in conservative Spain and increase its inclination towards the Axis for entry into the world conflict (Egido Leon, 2005, p. 109; Moradiellos, 2011, p. 2).
However, Spanish foreign policy would become even more mired, for there also existed conservative sectors more inclined towards neutrality, and even closer to the Allies, well represented by the Minister of Foreign Affairs, Gómez-Jordana, who in large measure opposed this fascist trend in Spain. Both figures primarily gave rise to numerous governmental crises between Falangists and military men for power; where a moderate Franco emerged as intermediary and became the true victor of this dichotomy of the dictatorship (Egido Leon, 2005, p. 118; Tusell and Queipo de Llano, 1985, pp. 23-42).
In one of these crises Serrano would end up imposing himself in autumn 1940, thereby causing the Spanish position to be even more noticeable with the Axis (Tusell and Queipo de Llano, 1985, pp. 105-106). However, it must be noted that this was merely an identification with these nations, as no military treaty adhering Spain to these powers existed; only notable gestures such as leaving the League of Nations, signing the Anti-Komintern Pact against communism or even their help during the war (Tusell and Queipo de Llano, 1985, pp. 32-38).

In any case, Spain, which did not want to be left out of the Axis victory, especially since Italy's entry into the war in June 1940, declared itself non-belligerent as a preliminary step towards military intervention (Egido Leon, 2005, pp. 105-106). After this it mobilized its army along its borders (although it has always been defended that the character was defensive against the possibility of an attack by the Allies from North Africa and Portugal) and occupied Tangier, now within Spain's Moroccan protectorate (Tusell, 1995, pp. 167; Tusell and Queipo de Llano, 1985, pp. 120-153).
From then on, constant diplomatic conversations of the Axis took place to get Spain into the war, as Falangist press encouraged it and authorities' responses positioned the country close to this in case its allies needed help (Egido Leon, 2005, p. 117; Tusell and Queipo de Llano, 1985, pp. 128-129).
Despite this, the general tone was Franco's caution in light of the circumstances at hand, even when intervention seemed more likely (especially after France's defeat and the expected one in Britain in June 1940), as he was aware that conditions for another war were poor (Tusell and Queipo de Llano, 1985, pp. 139-146). A good indication of this left Mussolini: "How do you bring a nation into a war when it has reserves of bread for one day?" (Tusell and Queipo de Llano, 1985, p. 214). Thus they made clear on numerous occasions, highlighting key moments such as Franco's interviews in Hendaye (France) with Hitler in October 1940 and the one in Bordighera (Italy) with Mussolini in February 1941 (Egido Leon, 2005, pp. 109-110).

The pretext was always the same: Spain seemed ready to enter the war, but under a series of previously agreed conditions and at an appropriate time. It wasn't enough for it to take Gibraltar (essential for geostrategic control of the Strait), but mainly it demanded the expansion of Spanish Morocco and significant food and military aid to start hostilities (Egido Leon, 2005, pp. 107-108; Tusell and Queipo de Llano, 1985, pp. 184-205).
A well-known response from the Führer to the rejection of Spanish claims summarizes very well the lack of understanding between both sides: "I'd rather have three or four teeth pulled out" (Tusell and Queipo de Llano, 1985, p. 199). And it is that Hitler saw Spain was demanding more than he could offer (Moradiellos, 2005, p. 133).
However, in the face of reality that the conflict turned against the Axis in winter 1942-1943, Spain, always economically encouraged by the Allies who feared such intervention would be real, would tend progressively towards a necessary neutrality, now with Jordana's support until the end of the conflict; and thus attempt to go unnoticed from contacts it had with the war's defeated (Moradiellos, 2011, pp. 1-3; Tusell, 1995, pp. 331-334).
Conclusion
Without a doubt, Spain was positioned and linked to the Axis powers during these early years of World War II (1939-1942), but we cannot affirm that it officially intervened. The economic reality of the country distanced itself from being able to do so hoping for victory on its own terms, hence the impossible claims by Germany. Perhaps this was Franco's strategy, saying he wanted to enter the war to never actually do so or only when already decided (Egido Leon, 2005, p. 109).
Similarly we cannot declare that in those years the dictatorship was fascist, but it was in process of becoming so if Falangist sectors had finally imposed themselves over conservative right. The course of the war forced an ideological shift and defined what would be a military authoritarian regime with great attachment to Catholicism and Nation in subsequent decades.
Bibliography
Egido Leon, A. (2005). Franco and World War II: A Compromised Neutrality. Ayer, 57(1), 103-124.
Moradiellos, E. (2005). Franco against Churchill: Spain and Britain during World War II. Ediciones Península.
Moradiellos, E. (2011). Franco and World War II. Revista de libros (172). https://www.revistadelibros.com/franco-y-la-segunda-guerra-mundial/
Preston, P. (2002). Franco: Caudillo of Spain. Grijalbo.
Tusell, J. (1995). Franco, Spain and World War II: Between Neutrality and the Axis. Temas de Hoy.
Tusell, J. y Queipo de Llano, G. (1985). Franco and Mussolini: Spanish politics during World War II. Ediciones Península.
Comments