Britain’s vote to leave the E.U. gives Spain new impetus in its attempts to take back the strategically vital and economically prosperous territory.