The short answer is because complaining is louder than passive agreement.  It often doesn't matter if a bill is popular if there's a vocal objection to it by a sufficient minority.  The objection can be in the form of protests, or a special interest or in some cases, an issue that can swing votes, but some kind of objection, with enough teeth to get noticed, can be enough to block a law even if that law passes the majority vote test.

We don't see situations like that come up very often because most issues we hear about get people polarized so you get people and/or special interests yelling objection from both sides and the politicians will for the most part, defend their side.  It's less common to get objection from only one side, but the sugar tax is an example of that.   I've never heard anyone say "god dammit, how could they fail to tax sugar again - vote that guy out of office".

There's not really a big "no tax on sugar" constituency either though there's probably some effort by soda and candy manufacturers. But there's also the people who like soda who don't want a tax on what they like.   There's also a pretty fair number of people who object to government intervention of any kind.  The "[don't tell me to wear a motorcycle helmet][1]" protesters as a rather funny example, or a more relevant example, [Mike Bloomberg's no big soda law][2], was the subject of ridicule by people who felt it wasn't government's place to write that law. Even though [the department of health liked it][3] people called it a nanny state and if you talk to people on the street or do a google search and you'll see that a lot of people ridiculed Bloomberg's soda bill.  

So to sum up, 60% popularity of a bill doesn't do much when that 60% isn't invested.   A vocal minority is often able to get more politicians on their side than a mostly indifferent majority and believe it or not, there actually is a somewhat organized and vocal objection to ideas like a [sugar tax or Mike Bloomberg's large-soda ban][4]. 

That said, and as you note, soda taxes have happened, though they are often unpopular.  This article suggests that the [Philly soda tax][5] was about raising money for a cash strapped state as much or more than it was about concern over the dangers of sugar.


  [1]: https://www.theguardian.com/lifeandstyle/2018/mar/17/australian-cyclists-risk-fines-with-helmet-optional-protest-rides
  [2]: https://www.forbes.com/sites/realspin/2013/05/10/the-michael-bloomberg-nanny-state-in-new-york-a-cautionary-tale/#33f17a497109
  [3]: https://www.nytimes.com/2012/09/14/nyregion/health-board-approves-bloombergs-soda-ban.html?mtrref=www.google.com&gwh=70822F81E383EB8C8CC4EE167498A03C&gwt=pay
  [4]: http://www.chicagotribune.com/news/columnists/schmich/ct-soda-tax-mary-schmich-0804-20170803-column.html
  [5]: https://www.cnbc.com/2017/08/22/philadelphias-soda-tax-isnt-the-windfall-some-had-hoped-for.html