Beginning with the Enlightenment in the XVIII century, a tradition developed all over Europe to collect the bits and pieces of all kinds of activities, subjects and the like, and to anthologise it all in one place. It was the same principle that gave rise to the compilation, first, and then the extensive usage of encyclopedias and dictionaries, the emergence of academies - of art, of language, of historical studies and the like.
The first and most representative example of this amassing of wealth and display of means, of richness, of power, was the creation of the Museum El Prado, in Madrid, just after the departure of French troops in 1814. Originally intended to home the collection of the Royal Cabinet of Natural Science, the building ultimately was turned into Spain´s first museum, and to this date its most visited one.
In recent times, however, the Spanish state has shown its determination to disseminate art museums all over the country, as you will be able to see from this short an selective list, which purposely points out institutions in a large number of provinces. If museums are your thing, in Spain there is one for you nearby, no matter where you are.