This depends on political context. In much of the western world outside the US (and partially in the US) healthcare is a publicly funded service. If you pay for your neighbors healthcare, then your neighbors obesity is an externality.
> or cigarettes, on the other hand, there are two potential externalities to tax.
And again here: my neighbors lung cancer is on my taxes, so effectively the only fair cost of cigarettes includes all treatment from all smoking and of course all lost tax revenues from the sick smokers who couldn't work etc. That's a lot more money needed than to cover just second hand smoke as an externality.
And even if you don't factor in public healthcare, an unhealthy population is an externality although not as immediately obvious.
This is getting off topic, and say what you will about America's atrocious healthcare system, but the fact that it is not fully socialized is NOT the problem. Real problems: artificial non-market based demand created by partial socialization (medicare and medicaid buying programs) raising prices for the non-socialized group, oppressive FDA (costs 1 billion usd on average to push a drug through), oppressive occupational licensing (very high barrier to entry to becoming a doctor), imbalanced IP system (especially for chemical/drug patents), and plenty more. Eliminating these problems would go a long way to making America the world's best healthcare system (it already is in some regards -- do some research on where all the prime ministers of social medicine countries go for their important surgeries since their systems haven't incorporated the American medical tech yet).
There are still issues to consider with emergency care (where there is typically not market-based selection of your healthcare) but I think government incentives aiding a market based system (similar to the incentives created by Singapore, arguably the best current system) would create a system so superior to any other country's medical system, that it wouldn't be such a central political issue.
Universal healthcare itself is a huge discussion but seems off topic here.
But pure sin taxes like soda/gambling/recreational drug taxes, where an individual is only affecting themselves, are effectively the government and busybody supporters of the policy playing god of morality. I've actually heard people suggest that drinking soda or using pot is an indirect externality as a result of the potential to 'change' users, and that its indirect effect on society via people's free association with such things is a justifiable externality. That implies that society is entitled to aspects of a person actions and characteristics outside of their lawfulness. It's a very socialist and anti-individualist argument, which I disagree with on a fundamental level.
Now for cigarettes, on the other hand, there are two potential externalities to tax. 1. The smoke that affects anyone near the user. 2. The addictive factor (nicotines), which is an externality against its users created by (and the tax should be applied to) the manufacturer.
Not to mention all the environmental externalities that should be applied at each stage of the supply and manufacturing chain due to fuel/processing/chemical effects on the environment/energy used/etc. However, these are common to all externalities, and if I had my way I would tax externalities in a direct and systematic way like this across the board, such that the tax is sufficient for the government to "undo" the externality. If there is no feasible way to undo it, it should be illegal.