The city of St. Albert passed the bylaw in 2012 after the Chad Smoke Shop opened its doors.
A Court of Queen's Bench judge in Edmonton struck down the bylaw.
Justice Terry Clackson ruled the city didn't have the legal power to pass or enforce what amounts to a criminal law.
The city appealed the decision and the Alberta Court of Appeal has ruled the bylaw is valid.
The Appeal Court says the bylaw has both federal and provincial components.
"In this case, there is significant overlap between the provincial and federal aspects of the bylaw," says the court decision released Thursday.
It says the federal government has power over criminal law, while the provinces dictate business licenses and regulations.
"Having concluded that these aspects are of roughly equal importance, we apply the double aspect doctrine for judicial restraint to uphold the validity."
The city's lawyer, Gene Klenke, said officials are weighing their options about whether or not to enforce the bylaw and charge the owner of the shop. He said the owner still has the option of asking the Supreme Court to hear the case.
The bylaw restricts businesses from displaying or offering for sale three or more "restricted products." The items include bongs, vaporizers, pipes or products that display pictures of marijuana plants.
If convicted, a person faces a fine up to $10,000 or a year in jail.