I understand what you are saying, but picture this: the governor of Florida dislikes the federal government and, even throw he know the US Constitution disallows the secession of a state, announces a referendum to vote for independence. He is given plenty of warning that moving forward with it is illegal, yet he sticks to his guns, misusing public funds to pay for it. What is the penalty for that in the US? Is it excessive in your opinion? How does the opportunity of parole look like compared to Spain?
Incidentally, much like it happened with Brexit, the "leave" campaign makes all sorts of promises that it could never deliver: catalonians would keep their Spanish passports, they would continue to receive Spanish pensions, they would automatically remain part of the EU and NATO, they would not be burdened with any of the existing public debt (bond obligations), etc.
Misled with all these transparent lies, around 40% of those called to vote actually show up, while the rest of the people listen to the advice of the central government urging them not to vote and take part in that farce. Unsurprisingly, most of the people who voted were hardcore leavers.
I don't like how the Spanish central governments have handled the situation. But it's also true that there's been an outstanding marketing campaign online to paint a minority of catalonians as "the true will of the Catalonian people" and it's tiresome to hear foreigners voice strong opinions about something they understand so superficially.
Lots of Spaniards like myself are tired of the situation. Want to secede? Fine. Let's follow the law, ammend whatever needs to be ammended, have some basic plan for fundamental questions like membership to the EU, pensiond, debt obligations, etc. The, with an understanding of what is on the table, vote for it. Just like Brexit should have been done.