SAN FRANCISCO (CBS SF) – A federal appeals court ruled Thursday that a San Francisco medical marijuana dispensary can’t deduct business expenses for sales of the drug from its taxable income.

A three-judge panel of the 9th U.S. Circuit Court of Appeals said Vapor Room owner Martin Olive couldn’t subtract such expenses because federal tax law bans deductions for a trade or business that “consists of trafficking in controlled substances.”

Even though a 1996 California law allows the use of medical marijuana, “the use and sale of marijuana remain prohibited under federal law,” Circuit Judge Susan Graber wrote.

Olive established the Vapor Room as a medical marijuana dispensary then known as the Vapor Room Healing Center in a large rented room in the Lower Haight District in 2004.

Among other amenities, the facility provided vaporizers that enabled patients to inhale the vapor of marijuana extract instead smoking the drug.

The business closed its storefront in 2012 after federal prosecutors threatened to file a civil forfeiture lawsuit against the landlord. The action was one of a series of enforcement efforts pursued by U.S. Attorney Melinda Haag of Northern California against dispensaries located near schools or parks.

Olive’s lawyer, Henry Wykowski, said the Vapor Room has operated as a medical cannabis delivery service since then and is now considering reopening in another location.

The tax case concerned Olive’s business income in 2004 and 2005, when he operated the facility as a sole proprietorship. In 2006, the dispensary was incorporated as the Vapor Room Cooperative.

On his business tax returns, Olive listed net income of $65,000 and $34,000 for those two years, together with business expenses of $237,000 and $418,000 for those years.

He appealed to the San Francisco-based appeals court after a tax court judge denied the expense deductions.

Olive claimed in his appeal the law prohibiting deductions didn’t apply to him because the Vapor Room provided other services, such as free counseling, education and snacks, in addition to the sale of marijuana. He argued the law’s use of the phrase “consists of” meant that the ban on expense deductions should apply only to a business whose sole service was drug sales.

But the appeals court said Olive couldn’t deduct expenses for the other services because he didn’t charge any money for them.

“The only ‘business’ in which he engages is selling medical marijuana,” Graber wrote.

The panel noted, however, that its decision didn’t conflict with a 2007 tax court ruling in which a different dispensary was allowed to deduct expenses for counseling services, although not for drug sales, because in that case the facility charged fees for the counseling.

The panel also rejected a second argument in which Olive contended the 1982 law was aimed at street dealers and that Congress hadn’t envisioned medical marijuana use when it passed the law.

The court said it would be up to Congress to change the measure.

“The only question Congress allows us to ask is whether marijuana is a controlled substance prohibited by federal law,” Graber wrote.

Even though Olive lost his case, Wykowski said the ruling was “good for the industry” because it appeared to uphold the doctrine that dispensaries can deduct expenses for services other than marijuana sales.

“This is going to benefit dispensaries that sell a variety of services including those that are not cannabis sales,” Wykowski said.

© Copyright 2015 by CBS San Francisco and Bay City News Service. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.