U.S. District Judge Robert Jonker said the law, approved by voters in 2008, bars authorities from prosecuting people for marijuana use but doesn't tell private employers what to do.
Joseph Casias, 30, was an inventory-control manager at a Walmart in Battle Creek, 50 miles south of Lansing, until he tested positive for marijuana in 2009. He has a medical-marijuana card and smokes pot to alleviate symptoms of an inoperable brain tumor and cancer.
Under Casias' theory of the case, "no private employer in Michigan could take any action against an employee based on an employee's use of medical marijuana," Jonker said. "This would create a new protected employee class in Michigan and mark a radical departure from the general rule of at-will employment."
The American Civil Liberties Union, which represents Casias, said it would appeal.
"A choice between adequate pain relief and gainful employment is an untenable one that no patient should ever be forced to make," attorney Scott Michelman said.
Wal-Mart said it was pleased with the decision and sympathetic to Casias' medical problems.
"We have to consider the overall safety of our customers and associates, including Mr. Casias," spokesman Greg Rossiter said. "Until further guidance is available, we'll always default to what we believe is the safest environment."
Casias, who was associate of the year at his store in 2008, declined to comment. He remains unemployed, ACLU spokesman Will Matthews said.