Well look at the situation with cigarettes. We probably both agree they are bad for you.
Yet they are not banned, and you can quite legally smoke yourself to an early death if you so desire.
Don't mean to be pedantic, but smoking is banned in many scenarios and situations, (under 18, in public places, in the workplace, etc) and the government has tabled a plan to eradicate smoking completely by 2030, something I fully support.
Food is a much more complex problem, I fear. For one there are likely to be lots of unintended consequences to legislation. Say you ban sugar or put a cap on it. Next thing you know, the market is flooded with products using Aspartame or corn syrup. Neither of which are all that great either.
Food is a more complex problem, because we actually
need food, we need a food industry, we can't ban - nor should we ban, the food industry. Unlike the tobacco industry, which I'd to see razed to the ground tomorrow.
Legislation against the food industry will mostly only be problematic because of money, and very little else.
The best way to legislate, is basically to reduce the amount of bad food, because there's an imbalance in food availability. It would mean forcing the closures of fast food outlets, placing restrictions on the amount of those outlets that exist and where they can exist. Followed by forcing supermarkets to redistribute the types and amounts of foods that they sell. Mostly because the current contents of a modern supermarket are a joke. And a whole host of other measures, all of which will impact the bottom line of the food industry's junk food sector (As it should)
The food industry has gotten away with producing borderline poison, whilst absolving itself of responsibility at every turn, and it can only go on until a certain point - my prediction would be roughly another 10 years, at that point we'll start to see large-scale blanket bans on certain products.
The fact that I agree food producers are largely amoral does not mean that it should follow that the answer must be to take away personal responsibility.
Well you have two competing forces, the food industry hijacking the biology or people (indeed children), vs the willpower of people to resist it. And it's a weird fact, that many decades ago, nobody
needed personal responsibility to stay a healthy weight, nobody had to watch what they ate, nobody had to worry about how many calories they were consuming, because they weren't being lambasted by an enormous conglomerate of companies hellbent on making money at any cost. There was no obesity (the word was largely unknown) type-2 diabetes existed mostly in alcoholics, and everybody was skinny.
The notion, that you need to have a sense of ironclad personal responsibility, just to stay a healthy weight is actually insane, when you think it through, because for 99.9% of human history, it simply wasn't a problem.