Taxes can be redirected to the poor or even used to subsidize other food choices. The point is people and companies would make different choices if empty calories where relatively more expensive.
The same is true of carbon taxes, they don’t extract money from the economy they move it around within the same economy.