Europe
In the Netherlands there was an action 1-2 years ago to get free tap water in restaurants and you can recognize the restaurants that do so with a sticker on the window. (Dutch links)
In Belgium there is no law regulating it. (Dutch link)
in Spain you will generally get free water:
Water is frequently served without a specific request, and is normally
charged for--unless it's included in your menu del dia. If you would
like free tap water instead of bottled water, request "agua del grifo"
(water from the tap). However, not all restaurants will offer this and
you may be forced to order bottled water.
United Kingdom
In England and Wales, it is mandatory if you sell alcohol:
Condition 3. Free Tap Water for Customers
Many premises already offer free tap water. This condition means that all premises have to give customers tap water for free if they ask for it. This helps people to space out their drinks and not become intoxicated quickly, which reduces the risk of crime and disorder occurring.
The tap water you provide should be suitable for drinking and must be provided where reasonably available.
What is meant by “reasonably available” is a question of fact; for example, it would not be reasonable to expect free tap water to be available in premises for which the water supply had temporarily been lost because of a broken mains supply.
The same goes for Scotland:
(2) Tap water fit for drinking must be provided free of charge on request.
Australia
In New South Wales, since 2004:
It is mandatory to have free drinking water available to patrons at all times liquor is sold or supplied in licensed venues.
In Victoria since 2010:
licensed venues that supply alcohol for
consumption on-site are required to provide free drinking water to their
patrons.
Exemptions may be granted upon request.
In South Australia, the Liquor Licensing Act 1997 does not require it, but in the City of Adelaide there is a goodwill (voluntary) Adelaide Liquor Licensing Accord which covers it.
In Queensland, all licensed premises in Queensland are required by law "to provide drinking water to their patrons for free or at a reasonable cost."
The Liquor Regulation 2002 has been amended to include a requirement for licensees to make drinking water available to patrons free of charge or at a reasonable cost. For example, a glass of tap water should not cost more than a glass of soft drink.
The Northern Territory's Liquor Act does not specify water must be provided.