The Centers for Disease Control has opinions on which countries' drinking water is safe, and 5thEye has mapped their advice:
As you can see, the CDC is very cautious, essentially arguing that only the richest countries have safe drinking water. In my personal experience, drinking tap water in Argentina, Vietnam, Cambodia, China, Costa Rica, Slovakia, Russia, and even the dread Mexico has worked out just fine. But your mileage may vary.
The World Health Organization uses a looser criteria for access to safe water, and by their standards it is a very serious problem in quite a few very poor countries but not many of the middle-income ones on the CDC map.