The larger a country is, the more powerful it is. Which is why leaders do not like to see countries break up, devolve or leave.
The UK without Scotland is less of a entity.
The EU without the UK is less, and Spain without Catalian is less.
The EU do not want any of its member states to break up, so they support the anti-independence rulers in the UK and Spain. But the EU angle is really a side show, the main force is those striving to keep the country whole and not diminished in power and influence.