¿habla castellano? is a phrase used to ask whether someone speaks spanish or not. But wait, shouldn’t it be “español” when we refer to spanish (language)?
“Castellano” comes from the word “castilian”, a kingdom in the Iberian peninsula (area covering the modern day Spain, Portuguese, and Andorra). The language of Castilian was originally Latin brought by the roman army to the Iberian peninsula. Since the latin turned into vulgar latin and got influenced by paleohispanic languages (such as Basque, and other native languages in the area before the coming of the roman army) and soon by the arabic language, in the Kingdom of Castile, the language is known as Castellano.
Both “castellano” and “español” are valid, but the Spanish prefer castellano because it is historically contextualized (due to the fact that it was developed in the Kingdom of Castile), and as some sort of acknowledgement of other officially recognized languages in Spain (Basque, Catalan, etc).
This has almost the same case with Japanese language and Filipino language. The standard Japanese was taken from the Tokyo dialect. Since then, the dialect is known as the standard form of Japanese. But they have never named it “Tokyo Language”. On the contrary, in the Philippines, the word “Tagalog” was used as the name for the language spoken there, because it was taken from the Tagalog (among other languages recognized in the Philippines), perhaps because it was the lingua franca. But now, the name “tagalog” has been changed into “Filipino” in order to give (IMHO) some sort of pride of nationality.