Catalonia and Barcelona have certainly exemplified the need to ask this question. When compared to many of its Eastern neighbors, you don't have people blowing up trains and kidnapping politicians all in the name of sepratism.
Well, the answer is "since it has existed".
The date usually taken as the foundation of the Kingdom of Spain is 1479, the year in which Ferdinand inherited the throne of Aragon, and Isabella won the Castillian Civil war, getting recognised as Queen of Castille. So, backing up, just before 1479 we had five kingdoms in the Iberian Peninsula (map).
(Note that each of this kingdoms has its own language.)
The Kingdom of Granada would be conquered by Castille in 1492, Portugal would remain independent and Navarre would be annexed in 1512.
However, despite Navarre, Castille and Aragon being ruled by the same kings, they were not part of the same kingdom from a cultural, administrative and political point of view. The different territories had their own law systems, languages, Courts, and even legal tender. The Catholic Kings did create some centralisation but never created an actual "single state" that would put the entire country under their direct control.
This situation would continue during the 16th and 17th centuries. As an example, Charles the First, when he ascended to the crown in 1516, had to go to each kindom to get proclaimed as king, and had to swear to respect the charters and privileges ("Fueros y privilegios") of the Kingdom of Aragon.
Another example is the case of Antonio Perez. Antonio Perez had occupied important places in Felipe II's court. In 1591 he was accused of participating in a conspiracy, and imprisoned in Madrid, but he managed to escape to Aragon. In Aragon, he put himself under the protection of the "Justícia d'Aragó" (Justice of Aragon, a judicial charge in Aragon). Despite Felipe II requests, the Aragonesse nobility refused to hand in Antonio Perez, and the whole issue ended when the royal army entered Zaragoza and apprehended the Justice of Aragon and Antonio Perez.
Another example is that most of the fiscal and human charge of Spanish wars during the 16th century was supported by Castille and its American colonies, and not by the other kingdoms. The Spanish "valido" (a sort of Prime Minister) tried to solve this in 1626 with the "Unión de Armas" ("Union of Arms"), but the proposal caused a rebellion in Aragon and Portugal so it was never implanted.
Those are just examples of the fact that from 1479 to 1715, the Kingdom of Spain was not a single kingdom but a Kingdom of kingdoms.
However, in 1700 everything changed. Carles the II died without children, and, long story short, Castille and Navarre supported a Felipe V (a Bourbon, grandchildren of the French king) and Aragon supported the Archduke Charles of Austria (son of the Austrian Emperor). Felipe V won the war, and, in his own words:
Considering having lost the kingdoms of Aragon and Valencia, [...] due to the rebellion they committed, [...] all the charters, privileges, exemptions and freedoms that they enjoyed , [...] I have judged it convenient, as well for this, as for my desire to reduce all my Kingdoms of Spain to the uniformity of the same laws, customs, customs and courts, governing equally all by the laws of Castile. (Decreto de Nueva Planta, 1707)
In 1715, the "Decreto de Nueva Planta" abolished all charters and privileges of all kindoms (except for Navarre and the Basque Country), creating, for the first time, an administrative uniform "kingdom of Spain". However, regionalisms never ended in Spain: each region had its own local language, and the new system wasn't liked by the kingdoms that had opposed the king.
The repression of austracist leaders in the Crown of Aragon and the outlawing of Catalan and other regional languages didn't help either.
Well, do you remember that the basque country had kept its privileges? Well, in 1833 Ferdinand VII died leaving his only daughter Isabelle II as heir and his wife Maria Cristina as Regent. Ferdinand's brother, Carlos María Isidro, rebelled arguing that according to law, a women could not reign; Maria Cristina was supported by the liberals and Carlos by absolutists. To gain the support of the Basque country, Carlos promised to respect the Charters and Privileges of Navarre and the Basque Country. As you may expect, this conflict caused not one, but three civil wars (the Carlists Wars) during the 19th century.
During the "Six Liberal Years" (1868 to 1874, during which the Spanish monarchy was expelled and Spain had a provisional government, a monarchy and a republic) the regionalist issue was very important. It was even debated whether to create a "Spanish Federation", and some regions declared themselves "cantons" (for example, Murcia declared the Cantón de Cartagena), something that sparked civil wars across the country.
Basque and Catalan nationalism would be present during the entire 20th century in Spain: Catalonia got some regional autonomy in 1914 (Mancomunitat de Catalunya), which it lost in 1923 due to the dictatorship of Primo de Rivera; in 1931, in the context of the Spanish Republic, Catalonia declared itself "a Republic inside the Iberian Republic" (in words of the President of Catalonia the 14th of April of 1931); it even got a "Statute of Autonomy" during that period. Franco abolished all of this and tried to delete any type of regionalism or non-national identity. And from the 70s to 2004, a basque terrorist group (ETA) would attempt through direct attacks to achieve Basque independence.
So, in conclusion: Spain has always had conflicts between the central government and the different regions. It has been a constant throughout history and even though (thankfully) armed violence stopped 15 years ago, it doesn't look like this debate will end soon.