This answer is about Spain, and only about some people in Spain. It is also an answer drawn from my knowledge and experience as a native speaker of Spain’s Spanish, a Spanish citizen and someone who has lived in Spain and overseas for extended periods of time.
This answer is also an extended and better version of a couple of comments I made to @hippietrail ’s answer, which have been unfortunately deleted by moderators. My comments were offensive in form, which I admit, and for which I apologise. But so is some of the content that I found on this page. Let me explain.
The first thing we need to understand is that Spain, like other countries in Europe, is a mosaic of cultures rather than a homogeneous mass. Maybe you think you already know this. And maybe you are right. But please keep reading just in case. I have lived overseas for years, and had the opportunity to interact with multiple people from different nationalities and backgrounds. I am always surprised that, for example, Canadians or Australians (and these are just examples, please don’t pick on them) think of their respective countries as being the epitome of multiculturalism. I agree that these countries are vibrant communities of diversity, but more often than not, these people miss an important difference: in Canada or Australia, nationalities and cultures have been "co-inhabiting" and brushing against each other for a few centuries, but in Spain or some other European countries, this has been happening for a few millennia. This is multiculturalism.
Specifically, Spain as a country was constructed in the 15th century, when different kingdoms and realms were united through political manoeuvring. As you can imagine, political union does not necessarily entail cultural union, especially when the different cultures are backed, as was the case, by different climates and geographical features, which in turn mean different crop and cattle raising habits and traditions, which in turn mean different lifestyles and economies. To this, we need to add the fact that up to eight languages coexisted in Spain. Castilian Spanish was the lingua franca imposed by the union.
The second thing we need to understand is that Spain went through a strict military dictatorship between 1939 and 1975. Amongst other values, this regime imposed the idea of unity, and to foster this it banned any language other than Spanish from Spain. The consequence was not, like @c4sh says in his/her answer, that Spanish became the only used language. How on earth would kids (and adults) that had been raised in Galician, Basque or Catalan, and who did not speak a word of Spanish, move overnight to speaking Spanish only? That’s ludicrous. What really happened is that those people became legally second-rate citizens, and often sent to jail, tortured and even killed. This happened just one generation ago, so it is still very alive in people’s memories. My parents did live this themselves, and I am only in my forties, so this is not ancient history. Kids at school who wouldn’t speak Spanish, which was the usual case for most kids in Galicia (the region where I come from), were sometimes forced to strip naked and walk under the rain like animals, since the teacher, following the precepts of the dictatorship, sustained that they could not speak properly and therefore were not people but just animals. And so on and so forth.
The imposition of a language on a community as an instrument of domination is a well-studied device, and the history of colonisation is full of examples. Spain is just one more.
I am finishing now. :-)
The term “Spanish”, to the mind of many people, means imposition, domination, banning of their native vehicle for communication. Jail, torture and dead relatives. “Castilian”, on the other hand, means a foreign language that you may or may not choose to speak.
You may argue that these are just words, and I can agree. But we should not forget that some people have gone through experiences that load words with intense meaning, and we might not be able to start imagining the power of such load.
Before we pontificate about something as complex as this, we are morally obliged to obtain a deep understanding of what we are talking about. I wouldn’t even dream of being opinionated about racial issues in the Deep South, aboriginal communities in Redfern, Sydney, or religious friction in the Balkans. I’d rather shut up, because stuff is too complex, people have suffered too much, and I’m too alien to those worlds. Similarly, I’d love to see a similar degree of respect elsewhere.
Just my two cents.