I don't know if we should or shouldn't but it deserves more thought than you're giving it.
For one thing, I seriously doubt prohibition could ever be politically viable, but increased prices or reduced visibility and availability of processed high-calorie ready-to-eat foods might be in some situations. We've already seen some of this, like New York's soda tax or banning vending machines from public schools.
Would you apply the same logic to drugs like cocaine, MDMA or similar?
They, too, can be taken and handled with care and moderation, yet are outlawed (even if sometimes only at the "distribution/dealing" level)
No, thank you. Please don’t tell me what tasty things I’m allowed to create or consume.
Regulation of this type is just group punishment, but advocates believe it to be some kind of altruism.
“People are getting fat!” Okay, but I’m not, and honestly I eat tons of junk. Why punish everyone who likes tasty food? If you hate obesity so much, then outlaw obesity. That’s a stupid idea too, but at least it more closely aligns the regulation with the result you want.