A federal judge has ordered the state of Utah to pay nearly $500,000 in attorney fees in the alcohol, sex and First Amendment case involving Brewvies Cinema Pub and its screening of the film “Deadpool.”

In the order, issued late Wednesday, Judge David Nuffer also warned the Legislature and the Utah attorney general’s office that passing and defending an unconstitutional law can prove costly.

“The political judgment of the State that it will enact a statute contrary to existing law and risk payment of legal fees is a legitimate choice, but it has consequences,” Nuffer wrote. “As long as the Legislature passes laws which the attorney general is obligated to defend, the financial risks to the State and taxpayers will continue. Legislative enactment of constitutional legislation — and abandonment or non-enforcement of unconstitutional legislation — is a better way to avoid this type of fee award."

(Rachel Molenda | The Salt Lake Tribune) Attorney Rocky Anderson praises the recent ruling by a judge against the state's Department of Alcoholic Beverage Control, while Norman Chesler, a member of Brewvies' management team and board, listens. DABC regulators threatened to fine Brewvies up to $25,000 and take away its liquor license in 2016.

The order called for giving Brewvies attorney Rocky Anderson and his staff $474,455.22 for defending the case.

Anderson, a former Salt Lake City mayor, initially had sought fees and costs totaling $596,906.35. However, the Utah attorney general’s office argued that was “excessive and completely unreasonable.”

Nuffer weighed several issues when determining the final bill, including reducing fees by $22,494.28, the amount of public donations Brewvies received for the legal fight.

Most of the award money will be given to the DKT Liberty Project in Washington, D.C., Anderson said. The nonprofit, which fights government overreach, offered significant help in the case.

“At this point, we do not have a comment,” a spokeswoman for Utah Attorney General Sean Reyes said. Officials from the Utah Department of Alcoholic Beverage Control also declined to comment.

Last August, Brewvies prevailed in its lawsuit against the state, ending a legal fight that involved the DABC and the superhero movie ”Deadpool.”

The case began in early 2016, when the DABC threatened to fine the theater up to $25,000 and temporarily rescind its liquor license under a law that bans serving alcohol during films with simulated sex or full-frontal nudity.

Nuffer sided with Brewvies, writing that while the state may have compelling interests to avoid ”potential negative secondary effects” from mixing sexual content and alcohol, the state’s enforcement mechanism, which it used against the theater, was ”not the least restrictive means for accomplishing” its goals under the First Amendment.

During the 2018 session, Utah lawmakers removed the unconstitutional language from state code prohibiting alcohol from being served during an R-rated movie in which characters have sex while nude.

Anderson applauded the change but said the state could have avoided the lawsuit in the first place if Reyes and his staff had taken a cue from their counterparts in Idaho and a case involving Meridian Cinemas.

Much like Brewvies, the theater filed a First Amendment lawsuit after it was ticketed for serving alcohol during a showing of the sexually explicit “50 Shades of Grey.” Rather than allowing the case to proceed, Idaho officials agreed to hold off enforcing the state statute until its Legislature could examine it more closely. Ultimately, Idaho conceded that it was unconstitutional and eliminated the state provision.

Anderson estimates the Utah case “cost taxpayers $1 million or more," when the legal costs incurred by the attorney general’s office are added.

“It’s something that could have been avoided,” he said, “if lawyers had just taken a good hard look at this and lawmakers had exercised a little wisdom.”