Spain don't see Gibraltar as a country, as they obviously claim it. It's like a few other countries who don't get drawn against each other because of politics.
Azerbaijan and Armenia are always separated too, as were Russia and Georgia though both governments have now agreed to play each other if matched. Israel are also in UEFA because half the teams in the Asian federation refuse to play them.