If members of the Utah Legislature really want the federal government to stay out of the state’s business, about the best thing they could do would be to stop passing laws that virtually come with a Post-It note that says, ”Kick me.”

Such was Utah’s so-called “ag-gag” law, which sought to prohibit the taking of photographs or video of slaughterhouses and other agricultural operations by those seeking to expose conditions that are unlawful, unsanitary or inhumane.

The law that was struck down by a federal court judge back in July. The one that the Utah Attorney General’s Office has now wisely, if belatedly, decided it can no longer hope to defend.

It took U.S. District Court Judge Robert Shelby 31 pages to eviscerate the weak arguments raised by the state’s lawyers. His task was made easier by the fact that the points raised in defense of the law in court were not the arguments used to get the measure through the Utah Legislature when it was passed in 2012.

In court, state lawyers tried to convince the judge that it was OK for the Legislature to criminalize attempts to expose wrongdoing in agricultural operations by people who would apply for a job or otherwise misrepresent themselves or their purpose. They said the point was to protect the interlopers, the other workers and the animals from disease and other harm that might ensue if anyone unqualified or unskilled were allowed in.

The problem with that argument, Shelby noted, was that it was not at all the reason given for the bill by its legislative sponsors. In the House and Senate, backers of the bill stressed that their goal was to stop animal rights activists, food safety advocates, “vegetarian people” and ”propaganda groups” from saying bad things — and supporting their arguments with video — about the industrial food system.

The same sort of activists who had, in other places, made us aware of facilities that basically beat animals to death, tossed live chicks into meat grinders and did other repulsive things that, come to mention it, might well make vegetarianism seem appealing.

Clearly, the judge found, the real purpose of the law is not public safety. It is to criminalize speech based on its content, the very definition of an unconstitutional abridgment of free speech.

The argument that the law protected farms, ranches and processing facilities from trespassing, which is already illegal, did not sway the judge. With or without the law, Shelby wrote, uninvited guests can still be ejected from the premises.

They just won’t be prosecuted for exercising the First Amendment the way it was intended, to tell people what’s going on around them.