Spain, unlike the UK, has a written constitution, in which the indivisibility of the state is stated.
This means that the first step for any region to legally have any chance of leaving Spain is to change the constitution, which needs bigger than simple majorities (3/5 or 2/3 depending on the procedure), so it's unlikely that this will happen any time soon.
The people that organised the referendum knew this and still went ahead and then things took a turn for the worse.