Maybe Spain would let in Scotland and claim Gibraltar as their own?
Is just that not the UK neither the people in Gibraltar want that. But yes, Gibraltar could face some problems when the UK leave the UE.
Long version: https://en.wikipedia.org/wiki/Disputed_status_of_Gibraltar
Germans are going to face a large hike in their contributions to the EU in the next few years as the UK leaves, as the EU appears to be utterly incapable of actually spending less (despite now having diminished responsibility). That's just not in its nature.
So then Scotland comes along. The best available data says it's an economic basket case significantly worse than Greece. The UK subsidises it to a great extent for historical and cultural reasons that don't apply to Germany. Meanwhile, 40% of Scotland voted out of the EU as well.
If you're German and already questioning whether you should be subsidising lots of low productivity high debt Mediterranean countries, does the thought of waiving the entry requirements and then paying even more taxes to subsidise a new Greece appeal to you?
Yup. "You lot can leave, but we'll take Scotland. Your choice."