Yes, UK should cede Gibraltar. If the UK is willing to break away from the EU, then they should be willing to break away from every part of it. If they keep some ties to the EU, Brexit wouldn't be fully complete. Ceding Gibraltar should be the next step for the UK.
The United Kingdom should not cede Gibraltar to Spain just because the country has voted to leave the European Union. The residents of Gibraltar have rejected Spain's attempts to take possession of the tiny territory with referendums voting against it. Furthermore, it is in the national security interests of the U.K. to keep Gibraltar as a British overseas territory.
There is no reason for Britain to give up any territory due to the Brexit vote. Gibraltar has been a part of the UK since the 18th century; nothing that happened with Britain leaving the EU has an impact on Gibraltar being British. To put it in perspective, Gibraltar has been British longer than some EU nations (e.g., Germany) have even existed. Further, Gibraltar is still a strategic location, one that gives Britain the ability to seal off the Mediterranean from the Atlantic. This makes it an asset for Britain today and into the future. Gibraltar should remain British, regardless of its relationship with the EU.
Gibraltar has been governed by Britain since 1713, there is no reason anything should change due to the UK leaving the EU. Most of the population are British citizens and although the majority wanted to stay in the EU, they should remain with Britain. The UK public voted to leave the EU and that is what should happen.