The revenue schools share with soft drinks suppliers can be as much as pound;50,000 a year, the equivalent of two teachers' annual salary.
The dilemma was revealed at a fringe meeting which reported young people are developing adult health problems such as diabetes. The trend has been linked to increasing child obesity.
Parents complain their efforts to encourage their children to eat healthily are being thwarted by schools that provide easy access to sugary snacks and drinks.
David Wilcox, a Labour councillor and member of the Local Government Association's education committee, said that at the secondary in Derbyshire where he is governor, Coca-Cola machines raised more than pound;25,000 a year, equivalent to a teacher's salary. "The bigger secondary schools can get in the region of pound;50,000," he said. "It is a difficult situation.
Schools are trying to promote healthy eating but cannot afford to lose that sort of money."
Benet Middleton, chief executive of the charity Diabetes UK, said urgent steps needed to be taken to improve children's diets.
A Coca-Cola spokesman said the estimates of revenue seemed high but did not have an average. He said the firm ensured school machines contained non-sugar options, such as water and fruit juice.