There is a long history of violence and oppression of a historical minority, the Catalan people, by Castile. On the Iberian peninsula, only Portugal succeeded in fending off the armies of the virulently ethnocentric absolutists (Bourbons). Following the Peace of Westphalia
WP and ensuing imposition of Bourbon centralism in Spain, the Catalans were finally put down in 1714 in the Siege of Barcelona
WP. These are a people whose own history, when independent, was characterized by
semi-democratic institutions and functioning, always with the sense of being a people and a nation, with their own language and customs, as old as those of Castilian Spain.
To put events in context, think of the US as losing its War of Independence in roughly similar times, yet retaining own identity and wishing to gain what was lost. You can imagine that, since 1776, many attempts would continue to be made to secure independence.
Recall that there are serious flaws in democracy, two of which are the dangers of mob rule, another that of the oppression of permanent minorities by a majority culture, race, religion, or ethnic group. The first is why voting results are constrained by both constitutional law and human rights, and the working of government by delegated representation. The second requires redress by the courts in defense of whatever rights or domain of action are being repressed. To make a long story short, the attempts by Catalonia to recover its language and identity after 40 years of the latest round of dictatorship have been met by "federal" law forcing a common language and identity. (A constant tug of war whose detail I avoid.)
As to the constitution, it was voted on with rattling sabers in the background. The choice of "no" was impossible, as that could've emboldened the fascists to decide democracy itself had been rejected. Proof of those sabers came on Feb 28, 1978, when the same paramilitary police now bloodying old ladies on Barcelona streets entered Las Cortes (parliament) and staged an attempted coup. (Anecdotally, these were my years of strenuous argument with the abundant fascists in Madrid society at the time, as well as the equally totalitarian-minded and culturally-centralist PSOE, the "socialist" party.)
For those looking for a smoking gun proving Madrid's anti-Catalan bias in policy, it can be found in the oft-sought but EU-nixed high-speed line through the central Pyrenees, empty country on both sides, in contrast with its extreme foot-dragging on much-needed new passenger and freight lines extending down Spain's east coast, past its largest ports, and its two major exporting regions, Catalonia and Valencia. Or, more anecdotally, simply listen to Star Trek Next Generation, for which the Catalan-sounding name of Geordi ("Jordi") LaForge was translated as the non-existent "Jorday." (No other main character's name was unnecessarily changed in any other TV series over the last 4 decades, to the best of my knowledge.)