Tim Sablik has an interesting literature review on secession on the Richmond Fed's "EconFocus." Sablik presents research relevant to the issue, including Alesina and Spolaore and Buchanan and Faith. He also deals with contemporary secessionist communities - like Catalonia and Scotland.
Sablik writes that "For secession to have the best chance of success, it takes consent on both sides." But of course that very rarely happens. The best (Perhaps only? I'd be interested in others) example of consensual "divorce" is Czechoslovakia.
Called the "Velvet Divorce," the secession was handled quickly and peacefully. But it's unclear what lessons from that event apply to today's movements. It was decided by leading politicians on both sides rather than popular referendum, which made it easier to reach agreement.
Sablik notes that the British government allowed the Scots to vote, whereas Spain ruled out any possible referendum for Catalonia. I suppose that we can compare the Scottish and the Catalonian secessionist movement insofar as their popular following and their political strength are concerned. Also, both nations are monarchies - which prompts another question. Is the royal factor increasing the likelihood of secession (because the reigning dynasty embodies the idea of a "foreign" domination) or decreasing it (because the monarch is a stronger symbol of unity that affects people's ideas?).
The question why the ones were allowed to vote, and the others were not, is indeed a very interesting one.
In part, it may have to do with the fact that "Resistance can usually be expected if the parent country would be made economically worse off by a region leaving," as Sablik points out. Perhaps among the British, the perception that they had not much to lose by Scotland leaving was so widely accepted that the referendum was politically acceptable. In Spain, it is a different story. And yet Scotland has oil ("Paul Collier and Anke Hoeffler of Oxford University linked the rise of the modern Scottish secession movement to the discovery of that oil in the 1960s," Sablik reminds us). I'd bet that voters tend to believe natural resources are something not to be separated from, inasmuch as it is possible.
In part, it may have to do with the fact the British Empire has long been falling to pieces, and so British voters are not particularly troubled from the idea of losing one more.
In part, it may have to do with the recent history of the UK and Spain. England takes pride in her legacy of liberty. Spain passed through the dictatorship of Franco. Its democratic constitution is quite recent and its leadership may feel that a Catalonian secession may be hitting too hard a still fragile body.
Both the Scots and the Catalonians promised their loyalty to the European Union. You would think that, if a transnational body like the EU has any sense at all, it would be at least somehow "regulating secession" within its territories, allowing for a constructive and properly ordered exercise of the right to vote yourselves out of a country. That doesn't happen. The EU is a cartel of states as they are, for which any change may sound frightening.