I was never engaged in the study of this question, that is true. To me the nationalism was like when the sky is cloudy or some other natural phenomenon, like the hail or a windy storm. But one day, I was reading an article in one of those Sunday newspapers supplement. The article was very simply, but somewhat it enlightened me.
A photo of Carlist troops
It all started after some Spanish wars of 19th Century between conservatives and liberals. The Basque and Catalan industrialists had a bad opinion of the liberals, and not so much for the aspect that Liberals were free-thinkers and showed some disrespect of religion. Liberals had a fame of opposing the power of religion. But from the point of view of a Basque and Catalan industrialists, their worse sin was to be in favor of free trade. Being in favor of free trade was a treason to their interests. And thus it was mainly the reason they fought against the liberal party during the Carlist wars. They wanted to oppose the liberals. I copy from the Wikipedia the following,
the followers of Infante Carlos (later Carlos V) and his descendants — rallied to the cry of “God, Country, and King” and fought for the cause of Spanish tradition (Legitimism and Catholicism) against liberalism,
Basically the Cristinos were liberals. The name comes from the Regent Cristina de Borbon that was called Queen Governor. Cristina was the mother of Isabel II that become queen some time later.
A phrase from the Wikipedia say,
The Cristinos were the supporters of the Queen Regent and her government, and were the party of the Liberals.
If you are a rich industrialist, the idea of liberals imposing a free trade from Madrid had to be an anathema. On the other hand, another idea of the liberals was to change the inheritance system, the Majorat.
I copy from the Wikipedia,
In practice it meant that only older son had the right to inherit any serious land property in Spain. Then, if you were a rich landowner, this law projected by the liberals, of abolishing the Mayorat, had the virtue of annoying you seriously. Then, we have here also a little the root from where it started the hate of Madrid, where the Liberals were ruling and changing Spain in the XIX Century.
In the XIX Century, there was an increase of industrial output, both in the Basque provinces en in the Catalan ones. We can check this on the Net if there is a reason to doubt. I had not checked it.
The Liberal politics robbed some of the prestige of the Catholic church. But the main way to control of population growth that was to put the excess of young people in convents and monasteries. As the Liberal propaganda increased, the power of the church waned. Then, as the young people do not wanted to be imprisoned for life in convents or monasteries they rebelled and resisted to their families to be put in monasteries. As the young people become free it caused a sudden spurt of population growth.
Coming back to the Basque and Catalan provinces, the population growth of rural Spain resulted in a great immigration towards the rich provinces of the north. This was not the only problem. The imports of wheat from the US, lowered the prices of cereals and a lot of people working in the rural provinces of Spain lost their precarious works. They started a migration to Madrid, and to Basque and Catalan provinces where they created some social problems. Perhaps they were too many immigrants in a sort period of time.
This immigration had two sides. The nice side was it lowered the wages with en excess of workers. The nasty side was that many of those immigrants came ideologically contaminated with the ideas of anarchy and socialism. The pure population of the Basque countries and Catalonia were not contaminated yet by these viral ideologies.
If anarchism was not nice, socialism was even worse.
Both in the Basque and Catalan regions the immigrants spread of the corrosive ideologies was the main cause for a campaign of scorn and propaganda against those “nasty Spanish” immigrants. In the Basque Country Sabino Arana began a process of slandering the Spanish people in general, with the worse words and the crassest racism you can imagine. He was a lot worse than Churchill speaking about the Indians. It looked like the Basques and Catalans had arrived in spacecrafts from outside the solar system. And the people of Spain were a terrestrial inferior race, assimilated to the Bantus or other worse creatures. Summing up the thinking of Arana, the Spanish people were some sort of untermenschen.
To be from mainland Spain in the Basque or Catalan provinces was worse than to be an an Irish immigrant in the US during the XVII till the XIX Century. The Spanish had become a sort of social pariahs for Basques and Catalans.
While the scorn for the Irish in the US faded after WWII, the scorn for the Spanish people got stronger thanks to democracy in the Basque and Catalan provinces.
Then, I suppose the root of the scorn and hate for the Spanish people and Madrid comes from the “free trade” ideas of XIX Century Liberals of Spain.