The Spanish don't want to encourage breakaway states
I'm sure they don't want to lose their fishing rights either ;) The legal situation regarding the EU is a nightmare as it is a unique situation, and there's no real "law" about it.
CONCEPTUALISING THE BREAK-UP
( www.publications.parliament.uk/pa/cm201213/cmselect/cmfaff/643/64306.htm )
- There are three ways that the constitutional and consensual break-up of the UK could be regarded internationally.
Continuation and secession
The existing state (UK) would break into separate entities - "Scotland" and "the RUK". The larger, more populous entity (RUK) would become the 'continuing' state. The smaller entity (Scotland) that wished to leave would secede and become a new state and would (somewhat confusingly) be known as a 'successor' state. The continuing state (the RUK) would inherit the vast majority of the rights and obligations of the UK whereas the successor state (Scotland) would essentially start anew internationally.
(Ie Scotland would walk away with pretty much nothing, including no share of the national debt)
Separation
The existing entity (the UK) would break into two states (the RUK and Scotland) and each would resume their pre-1707 Union status. This would involve a 'disaggregation' or 'splitting' of pooled sovereignty so that Scotland and RUK would each maintain all existing legal relationships as far as was possible given the changed situation.[7] This is sometimes also referred as 'the co-equal states' scenario.
(Assets split/liabilities split)
Dissolution
The existing entity (the UK) would dissolve and become extinct. Two new states would come into being (the RUK and Scotland) but neither new state would lay claim to the legal personality of the UK which would have ceased to exist. It would essentially amount to a clean international slate for both states.
(Both rUK and Scotland have to reapply to everything)