Old habits, especially bad ones, die hard.

This underscores why the real value of sin taxes is their ability to generate cash. After all, taxes that truly succeeded in changing behavior would be self-defeating. If a cigarette tax forced all puffers to quit, there would be severe withdrawal symptoms not only for smokers — but for states that relied on the tax for revenue.

“On some level, politicians want these taxes to affect behavior,” said Kim Rueben, a senior fellow at the Urban Institute who studies state and local taxes. “But they’re kind of in trouble if it works too well. If it’s actually effective in changing behavior, governments lose that revenue source and have to figure out what else they can start taxing.”

Clinging to this implausible pretense — that a few pennies can help someone kick, say, a porn habit — is understandable. Most Americans like to think that they are guided not so much by their wallets as by their ethics. And American jurisprudence is supposed to be guided by lofty ideals, not the bottom line; our laws should be moral, not mercenary.

But even if sin taxes exist primarily to balance the budget, they have social value. The debate over enacting a new tax, or hiking an old one, is a window into the country’s changing psyche.

A soda tax, after all, is more than a soda tax. If enacted, it’s something of a verdict on who is to blame for rising obesity rates. (The answer: Purveyors of sugary drinks, who will presumably lose a few customers, and those with unhealthy eating habits.) And it tells us something about how we try to ensure that the population is healthy.

“Public health used to be about going after the elimination of pathogens, cleaning the well that spread cholera,” said Katherine Pratt, a professor at Loyola Law School Los Angeles who is researching fat taxes. “Now we’re going beyond that and trying to address behavioral risk factors, which leads to charges of paternalism.”

The debate surrounding a ballot measure that would legalize, regulate and tax marijuana in California is similarly enlightening. Advocates are not dwelling much on marijuana’s harmlessness or acceptance, but rather on the amount of money it could generate. A voter may believe using marijuana is bad, but exactly how bad? Enough to give up its potential tax revenue?