Something similar could be said about the UK. But they are actually more aggressive and Gibraltar harmful to the surrounding area (smuggling and off-shore societies).
UK makes claims about the surrounding waters (which as far as I know, they have no claim to) and it's very bullish about enforcing that right. Given the nationalistic derive UK is taking and the change in status because of Brexit, it is very likely that tensions will rise.
Gibraltar has been UK territory for longer than the US has existed. By all means grumble about it, but if you grumble about morocco claiming Melilla in the same breath and don’t see the hypocrisy you really need to try to take an objective look at your views.
If you want to draw comparisons with Melilla, it was an abandoned military plaza that was simply taken by the Castilian crown in the 15th century. It is not a colony, unlike Gibraltar (according to ONU). Morocco didn't exist as a clear political entity back then, so I am not sure what claims would they have to it.
And what I was "grumbling" about Morocco referred to the "Islote de Perejil", where Morocco claimed an inhabited island near Ceuta: https://en.wikipedia.org/wiki/Perejil_Island_crisis
And my personal views are that if Spain could easily get rid of Ceuta and Melilla most spaniards politicians would sign right of the bat. They are just a sinkhole of money, source of diplomatic tensions and immigration problems.