One billion people still practice "open defecation", UN experts said at the launch of a study on drinking water and sanitation.
"'Excreta', 'faeces', 'poo' … this is the root cause of so many diseases," said Bruce Gordon, acting co-ordinator for sanitation and health at the World Health Organisation.
Societies that practice open defecation - putting them at risk from cholera, diarrhoea, dysentery, hepatitis A and typhoid - tend to have large income disparities and high numbers of deaths of children under five years old.
Attempts to improve sanitation have focused on building latrines, but the UN says money was wasted. Attitudes, not infrastructure, need to change, it said.
"In all honesty the results have been abysmal," said Rolf Luyendijk, a statistician at the UN's children's fund Unicef.
Many countries have made great progress in tackling open defecation, with Vietnam and Bangladesh virtually stamping out the practice entirely by 2012.
The global number has fallen from 1.3 billion in 1990. But one billion people "continue to defecate in gutters, behind bushes or in open water bodies, with no dignity or privacy", the UN said.
The practice is still increasing in 26 countries in Africa. Nigeria was the worst offender, with 39 million open defecators in 2012 compared to 23 million in 1990.
The country with the largest number of public defecators is India, which has 600 million. India's relatively "hands off" approach has long been at odds with the more successful strategy of neighbouring Bangladesh, which has put a big focus on fighting water-borne diseases since the 1970s, Luyendijk said.
"The Indian government did provide tremendous amounts, billions of dollars, for sanitation for the poorest," he said.
"But this was disbursed from the central level to the provinces and then all the provinces had their own mechanisms of implementing … those billions of dollars did not reach the poorest."
India has now woken up to the need to change attitudes, he said, with a "Take the poo to the loo" campaign that aims to make open defecation unacceptable.
"What is shocking in India is this picture of someone practising open defecation and in the other hand having a mobile phone," said Maria Neira, director of Public Health at the WHO.
Making the practice unacceptable has worked in more than 80 countries, the UN says. The goal is to eliminate the practice entirely by 2025. Poverty is no excuse, the study said, noting the role of cultural differences.