General Franco and Portuguese Salazar had just agreed that their terrotiries wouldn’t be used by others as a base to attack the other country, that is, Hitler wouldn’t have had permission to attack Portugal from Spain.
Furthermore, General Franco knew at that point that the war was going to be longer, and did not want to join it.
Overall, Germany and Italy both used Romanian oil, which was relatively scarce if consumed by battleships and cruisers. That was an important factor regarding the underperformance of Italian units (a big untrained fleet) and the preference of Hitler for U-boats.
Taranto, the precedent of Pearl Harbor, was a tactic mistake from the Italian side (keeping the entire fleet in the same harbour) and, especially, a superb operation of Admiral Cunnigham and the British side.
A tactic that the US had adopted for the Atlantic fleet.