Ceuta and Melilla

How do the Spanish justify holding these outposts while wanting Gilbralter back?

I read an article where they said it doesn’t a matter if the local population of Gilbralter doesn’t want Spanish rule as the population is imported. Isn’t this the same argument they give Moroccco when they wanted Ceuta
back?

I think Ceuta and Melilla are becoming somewheat problematic for Spain, as they serve as easy gateways for illegal immigration and drug traffic - which Spain wants to control.
Both are basically colonial holdovers, as the rest of Northern Morocco was held until 1956. And are ostensably there to guard the entrance of the Mediterranean for Spain, perhaps to make up for the UK’s presence in Gilbraltar. Remember in 1956, Franco had already been embraced by President Eisenhower, but was still held in contempt by the other nations of Europe for being semi-fascist. So both Franco and Eisenhower may have wanted access to a listening post in a sensitive spot.
Isn’t “Europe” supposed to be coming together? I mean both are in the EU, both are in NATO. I suppose many Spaniards see Gilbraltar as a reminder of the bad old days when Spain was weak and unable to shake off a foreign power from its own shores.