We can agree the state violence and the conduct of the state police was reprehensible, and as you say, counterproductive. If you have a separate nation with its own language, like Catalonia or Wales, and there is a clamour for a referendum on secession, then the way to deal with this is not to send in armed police but give people the referendum as the UK did for Scotland, and have the debate before the vote so all the issues are aired.
With goodwill, an independent Catalonia could develop into a strong ally and trading partner for Spain, as Ireland has for the UK. The Catalonia issue is more than a few extremists trying to hijack the will of the people, but nevertheless, the irony is that if Spain had called their bluff and allowed a referendum, it's likely there would have been a majority for remaining Spanish.
The lesson is, these matters have to proceed with the people's consent, after detailed debate. Central EU constantly wants to suppress national argument in the cause of uniformity. It smacks of totalitarianism.