The post raises (and partially answers) one of the most popular questions asked by foreign visitors to Spain - is water from the tap OK to drink? The short answer, as can be seen from the fact that the blogger from Madrid Me Mata ordered it, is 'yes'. On the other hand, your body needs to get used to a country's water and many tourists report that what they drink from Spanish taps doesn't always agree with them for the first couple of days. Also, even if the tap water is drinkable, that doesn't mean it's necessarily nice - in Granada the local water tastes as good as mineral water, in Valencia it's not particularly pleasant.
According to the Spanish tourist board:
"Drinking water supply is guaranteed throughout Spain. We have stringent control systems that guarantee water quality. Nevertheless, in some Mediterranean coastal areas consumption of bottled water is widespread."
Remember that 'widespread' doesn't mean 'essential'. In public rest rooms and fountains, look out for the phrase 'agua potable' to make sure it is drinking water.
And how about being charged for it? Is this legal? It seems that it is, though the practice is uncommon. However, the restaurant can only do so if if the charge is clearly indicated on the menu. Look for 'agua del grifo' on the menu, or some other indication that it is not bottled water. Furthermore, according to this article on ADN.es, tap water can constitute part of a "menu del dia". This means that if you order your meal and ask for, say, a Coke and some tap water, they could legitimately include the (cheaper) water in your meal and charge you for the Coke.
It should be stressed that this is rare and I (so far) have never been charged for tap water in Spain.