Pot may be legal in Colorado, but you can still be fired for using it.

The state Supreme Court ruled 6-0 Monday that a medical marijuana patient who was fired after failing a drug test cannot get his job back. The case was being watched closely by employers and pot smokers in states that have legalized medical or recreational marijuana.

Colorado became at least the fourth state in which courts have ruled against medical marijuana patients fired for pot use. Supreme courts in California, Montana and Washington state have made similar rulings, and federal courts in Colorado and Michigan also have rejected such claims.

The Colorado worker, Brandon Coats, is a quadriplegic who was fired by Dish Network after failing a 2010 drug test. The company agreed that Coats wasn't high on the job but said it has a zero-tolerance drug policy.

Coats argued that his pot smoking was allowed under a state law intended to protect employees from being fired for legal activities off the clock. Coats didn't use marijuana at work, but pot's intoxicating chemical, THC, can stay in the system for weeks.

The Colorado justices ruled that because marijuana is illegal under federal law, Coats' use of the drug couldn't be considered legal off-duty activity.

"There is no exception for marijuana use for medicinal purposes, or for marijuana use conducted in accordance with state law," the court wrote.

Coats and his lawyers said the decision at least clarified the matter for workers.

"Although I'm very disappointed today, I hope that my case has brought the issue of use of medical marijuana and employment to light," Coats said in a statement.

Dish Network and other business groups applauded the ruling.

"As a national employer, Dish remains committed to a drug-free workplace and compliance with federal law," company spokesman John Hall said in a statement.

Twenty-three states and Washington, D.C., allow people to use medical marijuana. Alaska, Colorado, Oregon, Washington state and Washington, D.C., have legalized recreational marijuana.

The Colorado Constitution specifically states that employers don't have to amend their policies to accommodate employees' marijuana use.

Coats was paralyzed in a car crash as a teenager and has been a medical marijuana patient since 2009, when he discovered that pot helped calm violent muscle spasms. He was a telephone operator with Dish for three years before he failed a random drug test in 2010 and was fired. He said he told his supervisors in advance that he probably would fail the test.