In one of the most highly watched marijuana cases in the country, the Colorado Supreme Court ruled Monday morning that companies can fire employees for smoking pot—even if it’s off-duty and despite the drug being legal in the state.

The decision poses a major setback for legalization proponents, as it sets the precedent that state marijuana laws do not override federal law that declares the drug to be illegal.

“[Under] Colorado’s ‘lawful activities statute,’ the term ‘lawful’ refers only to those activities that are lawful under both state and federal law,” the court’s opinion reads. “[E]mployees who engage in an activity such as medical marijuana use that is permitted by state law but unlawful under federal law are not protected.”

The decision surrounds Brandon Coats, a 35-year-old quadriplegic who was fired by Dish Network Corp. after testing positive for tetrahydrocannabinol (THC)—the primary component found in marijuana.

Coats, who is confined to a wheelchair due to a car accident, was issued a medical marijuana license to cope with what he calls “violent” spasms.

“The term ‘lawful’ refers only to those activities that are lawful under both state and federal law,” Colorado Supreme Court rules.

Under the state’s Lawful Activities Statute, Coats’ lawyer argued his client should be protected from being punished for using pot through his legally-obtained medical marijuana license.

Coats maintains that he was never high during work hours, but Dish Network argued he was still in violation of their “zero tolerance” policy against drugs.

Because marijuana is still federally illegal, the court unanimously ruled against Coats in a 6-0 vote, affirming decisions handed down by lower courts.

Colorado commercialized the sale of medical marijuana in 2009. In November 2012, the state voted to legalize marijuana for recreational use and in January 2014, Colorado allowed for recreational pot stores.

The Colorado Attorney General’s Office, arguing in favor of Dish Network, said that if the justices ruled against the company, the decision “would have a profound and detrimental impact on employers in the state.”

“Simply put, zero tolerance policies provide businesses with an efficient means of avoiding difficult employment decisions and even litigation,” the attorney general’s office stated in a brief.

In light of today’s ruling, Dish issued a statement to press saying, “Dish is committed to its drug-free workplace policy and compliance with federal law, which does not permit the use of marijuana, even for medicinal purposes.”