Why do coffee shops provide sparkling water (mineral water) along with Espresso?
Cleansing the palate for the coffee is a good explanation. Yet there is another tradition of serving water with espresso or coffee, where the water is drunk after the coffee:
In Viennese coffee houses (a place where coffee has a long-standing tradition) many patrons will stay for some time as these cafes are not only a quick stopover for a sip of coffee, but a place to read the newspaper, interact with other patrons and generally spend some time. (There is even a genre of writing created in that special atmosphere). During that time, customers will likely order coffee first before switching to another drink like wine afterwards. The water served with the coffee is again used to cleanse the palate, so that the residual coffee flavour doesn't interfere with the enjoyment of the wine or other following beverage.
If you get served sparkling water, it might just reflect a local custom - in Austria and Germany sparkling would be the default when ordering or serving water, you'd have to specify that you want uncarbonated.
There is an alternative to the accepted answer. In many Middle Eastern countries water is served as a matter of course with espresso. In very hot weather, even people accustomed to the heat may forget to drink enough water. Coffee is a diuretic. The combination of heat and diuretic can actually be dangerous. It would be pretty thoughtless to serve coffee under these circumstances without encouraging people to hydrate.
Edit: Thanks to Sarah G for editing the "strong" out of "strong diuretic." Stephie's comment is correct and probably better to say that--regardless of coffee's weak diuretic effect--on a warm day the first thing a customer wants after an espresso is apt to be water. The "palate cleansing" idea strikes me as a stretch other than for professional tasters in a different context.
Espresso is from Italy, and sparkling water is very popular there, which is probably why it is so common to see sparkling water (as opposed to still) even here with coffee.
The reasons given above for serving water with espresso seem good. In addition, I find espresso on its own can be a bit dehydrating so I always drink it with cold water on the side in the summer.
It's not up to coffee shop owners to be sure grown adults take enough water on board to offset the onset of dehydration, surely this is the individuals responibility. The wate is a pallet cleansing routine and in my experience over 40 years the main type of water I have seen served was primarily ordinary still water from the faucet or tap, typically sparkling water costs money even if the shop employs a type of soda stream device that adds the gas to ordinary water, either way mostly(maybe outside Italy)it's plain still water I see being served on a regular basis.
PS* In relation to @MTSan's question regarding the relationship between roasting coffee and mineral water, there is none, other than the fact that some ppl use bottled water to make their coffee, they claim the mineral water in say Evian bottled water produces a better cup of coffee although I doubt coffee shops use bottled water, too expensive, but they do use filters in their water source. Regarding the roasting and the making of the coffee. Coffee is at its best(freshest) when you grind the coffee beans just before you make the coffee, weather it's an espresso machine or a pour over or aeropress, chemex ect. The four hours I don't know about but I do know the freshest of coffee is made when you use fresh coffee(roasted in the last 2 weeks). If you are using tap water which is fine it is best tou fill you machine the previous night, this gives the water time for the added chemicals put in the water by local Govt(fluoride etc) to evaporate. The coffee in supermarkets, esp ground coffee where you see the best before date on the bag as 2 years away, this is not fresh coffee even if it is vacume packed. Buy your coffee from a shop that shows when the beans where roasted, of course this is assuming you are making your coffee at home, a good coffee shop will know all this, look for speciality coffee shops, at least these shops know what they are doing and their mission is to produce the best tasting coffee they can.
Besides the fact I like the soda water, I think cleansing the palate both before and after expresso coffee works for me. Interesting, coffee is a stimulant which increases an adrenalin reaction in the body, and has been known to increase heart rate. Soda water is bi carb of soda, bicarbonate magnesium which calms the body. Whatever the reason, works for me!