Ceuta & Melilla (their mainland African territories) can be covered from mainland Spain. Melilla is ca 150 km from Spain, Ceuta only 25 km. The small Spanish islands off the Moroccan coast are no further away.
The Canaries consist of several separate islands, with six international airports: one on each of the larger islands, & two on one island. One airport has a military airbase attached. There are also two smaller airports on smaller islands, for inter-island use, which military freighters could fly into & out of from Spain. There are 5 runways over 3000 metres, 3 from 2200 to 2500 metres, & 2 from 1250 to 1500 metres.
Madeira & Porto Santo (Portuguese, thus friendly) is a bit over 500km away, with two airports, & runways of 2780 & 3150 metres.
Morocco is the only country with easy access to the Spanish African territories. Algeria would need to co-operate with Morocco, or (in effect) declare war on Morocco to attack Melilla or Ceuta. It could only do so from the sea, or via Moroccan territory.
We can see from this that unless an attacker could seize several islands (with a population of over 2 million - we're not talking the Falklands) very quickly, or quickly make eight separate airports unusable, before Spain could reinforce them by air, & seize or neutralise Madeira, Spain would not need carrier-based aircraft to cover its territories.