Most people eat sugar. In fact, I'm willing to bet that the proportion of people in the western world who have eaten sugar is close to 100%.
Not everyone is obese. Even in the US, where obesity is at its worst, it's around 35%. That suggests that 65% of people can consume sugar and then not become obese.
Certainly amongst my peer group of middle class graduates almost everyone eats sugar and almost nobody is obese. That suggests that people are perfectly capable of consuming moderate amounts of sugar without becoming rampant sugar addicts rapidly turning obese.
The physical cause of obesity may be the overconsumption of simple carbohydrates, but the socioeconomic distribution of obesity suggests that there's many factors which drive that consumption.
Causation does not require 100% determinism. If X causes Y, it means that inducing X will increase the likelihood of Y.
So counterexamples are not disproof. You'd have to construct a lab experiment with enough subjects and measure over a long enough time.
Unfortunately, it's difficult to construct a perfect double-blind study, because people usually know if they are eating sugar or not. Maybe if artificial sweeteners are good enough it might work, or maybe the experiment would still be convincing even if the subjects know.
I'd be interested to see the results of such a study for sugar and heroin. I probably should be able to cite one before I claim it as fact, but I didn't think it was a very controversial claim. I think it's mainly a question of degree.
When heroin was legal, addicts often took it in pill form which was cheap and sufficient to deter cravings. The chief negative long-term effect of being addicted to heroin is constipation...IF you can reliably keep a supply of it in pill form.
The negative effects we see in addicts today are mostly caused by two factors: (1) if you shoot up, needle - especially dirty needles - can be a vector for infection and diseases such as HIV, (2) if you can't get a reliable supply of known potency you can go through withdrawal or overdose - the wild swings are harmful. (Impurities in the drug can also be harmful depending on what it's been "cut" with.)
So if the drug were legal it'd be fine. But when it's illegal, some characteristics of an illegal market make it bad for people - those are problems related to the illegality, not really having much to do with the drug itself.
In fact, numerous studies have found exactly this.