It wasn’t the first time a federal judge has tossed out a Utah law, but it’s not often the judge goes on to tell Utah legislators to stop wasting money.

U.S. District Judge David Nuffer this week awarded $474,455 in attorney fees to Brewvies after the suds-and-cinema emporium successfully argued it has a constitutional right to sell beer and show “Deadpool” to a roomful of adults. Nuffer had ruled in August that the Utah Department of Alcoholic Beverage Control did not have a constitutional right to threaten to fine Brewvies up to $25,000 for showing the popular R-rated superhero movie while serving alcohol.

A DABC investigation of Brewvies had been prompted by this email from a Utah Attorney General’s office attorney, who sounds like a high school snitch:

“I hate to bring this up, but it is just too blatant to ignore. Brewvies is showing Deadpool. The reviews describe explicit sex scenes and male and female frontal nudity. I know some people who have seen it, and they confirm that it is very raunchy amid the bloody violence.”

In fact, “Deadpool” was the sixth highest grossing film of 2016, and film-review aggregator Rotten Tomatoes gave it an 84 percent rating.

But DABC investigators relied on a Utah law that said that no establishment serving alcohol could show a film depicting, among other things, nudity and sexual intercourse. That narrow definition went far beyond what the courts have defined as obscene content, and Nuffer essentially said the state should knock this stuff off.

“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."

Perhaps the deepest irony is that the half million dollars will go to former Salt Lake City Mayor and longtime legislative nemesis Rocky Anderson, the attorney who represented Brewvies.

If moral-policing legislators aren’t concerned by the financial risks of passing longshots, perhaps they should consider the political risks in a world where younger people see objections to shows like “Deadpool” as quaint.

Legislators have already changed the law that Nuffer struck down, but we may not be finished with extra-constitutional lawmaking.

Tribune columnist Robert Gehrke earlier this week obtained an early draft of a medical cannabis bill some legislators, the LDS Church and Utah Medical Association have been working on. The draft bill would make it a Class B misdemeanor to merely provide instructions on how to use a medical marijuana product, which appears to be a clear impediment to free speech.

Here’s betting Rocky will be ready.