Irrespective of this, Spanish Constitution has a very strong enforcement of Spain's sovereignty and unity. It belongs to all Spanish people. So if that is to be altered --i.e., any region wants to secede-- is a decision that must involve every Spanish citizen. So in order to proceed, either everybody needs to participate in such a decision, or the Constitution needs to be amended. The separatists do not want to proceed either way, so they are trying to do it "unilaterally". That's against the Constitution, and the State needs to protect itself from that.
Anyway, if Catalonia would eventually and legally secede from Spain, it will be automatically out of the EU. And in order to gain access to the EU, it would need to apply and be approved unanimously by every EU country. In other words, Spain may veto that.
My opinion: it's shooting yourself on the feet. I believe they never intended to secede, they were just pushing this road hard to negotiate better financing and money for Catalonia. They have been doing this for many decades. But this time they took it too far, lost control of it, and now they don't know how to back track it.