Yes, but you can't SPREAD obesity to others who don't want it and could get hospitalized from it. What you do to yourself, I don't care. When you expose others to hospitalizations, that is exactly what the tax is trying to prevent.
And yes there are taxes to mitigate obesity - See Sugar tax, Seattle (and many other places) -
https://www.seattle.gov/license-and...ax/other-seattle-taxes/sweetened-beverage-tax
CT, NY, Hawaii, and Washington state also have sugar taxes. I don't know what other cities have it implemented.