The simple answer is that Spain was not part of the Axis powers. Spain was officially a “non-belligerent” (at least in its own eyes) in the war. This meant that it was not exactly neutral but that it was not involved in the war militarily.
The more complicated answer is that Spain was certainly trying to help the Axis and that most Spaniards would have preferred a German victory at least in theory. The Germans were more likely to give Spain territorial concessions that it would have liked than the Allies were. The Spanish government was fascist just as the German and Italian governments were. The Spanish fascist government owed the Germans both “morally” and economically for Germany’s help in the Spanish Civil War. For these reasons, the Spanish helped the Axis in some ways.
However, Spain never actually entered the war and it did not allow Germany to do all the things Germany wanted to do. For example, Spain did not allow German troops to cross Spain to attack the British at Gibraltar. There are a variety of reasons for this. Early in the war, the Germans appeared to be winning and did not really feel the need for Spanish help. Later, when things started going badly for the Axis, it was much less clear to the Spanish that they really could benefit by getting into the war on the Axis side. For these reasons and others, the Spanish stayed out of the war even if they did generally favor the Axis side.