I think an important difference between sugary drinks and heroin is that there is an easy sugar-free alternative that people might swap to more often if it was cheaper.
Sugar seems to me more insidious, in that at first it doesn't really make you feel all that great. But there's a convenience factor. Sugary foods are usually "easy to eat", they're "right there". In this, I would argue this addiction gets built up over time.
Now I've never tried heroin, but from what I understand the effects are much more pleasant in and of themselves. Addiction sets in much more quickly.
All this is to say that maybe banning sugar would work. If the convenience factor goes out, and if there's no "wow factor" to trying it, there's much less potential for abuse and for addiction.