San Francisco has a decidedly selective way of policing healthy living. It curbs smoking by banning it nearly everywhere. Yet it still allows tobacco and marijuana sales, gives away syringes to addicts and wants to open drug-injection facilities. City politicians go after Big Soda with glee, but mostly stay out of the way of the more powerful alcohol lobby.

Some of those seeming contradictions make practical sense. Others do not.

This latest one is flat-out ludicrous: Embarrassed that the No. 1 vaping company is prospering on port property, city leaders are in a legal fury. The city attorney and a member of the Board of Supervisors have proposed to bar e-cigarette firms from renting city property and, more sweepingly, block the sale of e-cigarettes in the city.

The stated rationale, of course, is a concern for public health. After all, vaping companies prey on a young audience with candy-flavored offerings and a hip, streamlined device. For other users, e-cigarettes are sold as a pathway from the chemical harms of tobacco, though the danger of nicotine addiction remains.

E-cigs are no fad, with the big tobacco company Altria in December buying a 35 percent share of Juul, based on Pier 70, giving the company a value of $38 billion. This city, an ostensible temple of clean living, is home to the leading edge firm in the vaping game — and yet the proposed measures can’t chase it out of town as long as its lease runs.

That annoying reality no doubt is stoking the latest legislation. But the crusade needs a reality check. It’s not as if reasonable steps are not being taken to study vaping and restrict its appeal to youth. The city cracked down on flavored e-cigarettes through a ballot measure last year. The federal Food and Drug Administration is entering the picture with its own limitations aimed at curbing sales.

Vaping is a tempting public villain. Manufacturers should be treated with skepticism about claims that vaping is a benign habit. What vaping doesn’t deserve is a dose of shortsighted demonizing that does little to change the bigger picture of tobacco abuse and other health dangers the city is loath to confront.

City Attorney Dennis Herrera isn’t buying that version. “That’s all bull—,” he told us. He wants to suspend e-cigarette sales immediately. Young vapers can pull end runs around city rules, and assurances from e-cigarette firms about controlled access are worthless, he contends. Also, the FDA has let vaping firms market their products without testing and then given those companies a long deadline to conform. That’s why he’s demanding a sales suspension.

But he and Supervisor Shamann Walton, who is sponsoring the crackdown, are sidestepping the larger issue: smoking itself. Cigarette sales are still legal. Roll your own unfiltered joint, smoke a cigar, light a pipe or fire up a cigarette. You can do it all in San Francisco, now and in the future if the featured proposals are enacted. Vaping is only one corner of a vast, dirty habit.

There’s no love here for e-cigarettes. Inhaling potential toxins in any form is a clear health danger. But this crusade offers no cure beyond symbolism. Juul won’t be ousted from its perch on Pier 70. If it left, it could continue its work in another city. Tobacco and marijuana will remain on the shelves.

This plan is excessive, unworkable and more about safe politics than public health.

This commentary is from The Chronicle’s editorial board. We invite you to express your views in a letter to the editor. Please submit your letter via our online form: SFChronicle.com/letters.