I assume you're also in favour of Ceuta and Melilla being given to Morocco over the wishes of the people whos ancestors have lived there for centuries?
The difference of course being that Gibraltar used to be Spanish, while Ceuta and Melilla never have been parts of Morocco. Portugal has more claim to those two enclaves than Morocco ever did.
What I mean is that it is not that important who Gibraltar belongs to as far as the desire of their population and the surrounding territories are respected. I add the surrounding territories because they are their natural hinterland, independently to who they belong, and therefore there should cooperation for the common good. I could not care less whether it is part of Spain or not, if you are happier with it.
I mean they said pretty clearly that they should respect the wishes of sovereignty for Gibraltar, so presumably they would also extend the same to Ceuta and Melilla.
I think in a very abstract sense I agree that exclaves like this are weird and it would be cleaner if they didn't happen (Gibraltar returned to Spain, Ceuta and Melilla returned to Morocco), but that's thinking of this as a systems design problem rather than one that cares about people. I recognise that this is not an empathetic view, and my own opinion is worthless and I hold onto it very weakly.