The U.S. Department of Labor can’t do a good job of protecting workers if it’s being unfair.

A federal judge ruled last week that it was just that when it blocked shipments from Oregon blueberry farms in 2012. Two of the three farms took their case to court. U.S. Magistrate Judge Thomas Coffin ruled the Department of Labor “unfairly stacked the deck” against those two growers.

The department had basically told the farms: Sign that you are guilty or your blueberries go bad.

The three farms “voluntarily agreed” — that’s the way the department put it — to pay a total of $240,000 in wages, damages and penalties. The department said it would block shipment of the blueberries if the farms would not sign.

That’s “voluntarily”? Never underestimate the government’s power to create its own definitions.

In the court documents, one farm says it lost $89,712.41 in revenue because of rotting and overripe berries, while it frantically decided what to do.

Not only did the farms have to pay penalties and admit guilt, they also had to waive any right of appeal.

How is that fair?

As Coffin pointed out in his ruling, when the Department of Labor has used this legal authority — called “hot goods” — in the past, it has allowed manufacturers to put “the full amount of the proposed penalties and back pay in escrow.” But in these cases with perishable goods, the department required the farms to waive their right of appeal, confess wrongdoing and pay up without ever seeing any of the department’s investigative findings or how it calculated the alleged wrongdoing.

To make matters worse, the department apparently calculated some of the alleged wrongdoing in a questionable way. There was one alleged incident of a child labor violation. Most of the alleged violations, though, had to do with how blueberries were picked.

The department decided that workers were only capable of picking 60 pounds of berries in a day, according to Manny Lopez, a former investigator for the Department of Labor working for the attorney for one of the farms. If a worker had a ticket that showed he or she had picked more, the department decided someone else — “a ghost worker” in the department’s lingo — must have been illegally picking on the same ticket.

Lopez tested that the day after the department’s action. He got 16 workers and had them do a second pick on a section that had already been picked the day before. Many of them picked more than 100 pounds. He said one worker picked more than 190 pounds.

The department could still be right. But it hasn’t been able to prove it. It claimed in a letter to members of Congress that “more than 1,100 workers were found to be impacted by the growers’ improper wage practices.”

We asked the department last March how many of those “ghost workers” had been identified. It said about 50. We asked how many of them got the wages the department collected for them. It declined to say.

We asked again last week for an update. The department did not answer. The only thing it would release was a general statement saying it was preparing objections to the judge’s review.

There is nothing wrong with the hot goods law. It’s been a important tool in protecting workers. And agricultural workers can be among the most vulnerable to exploitation. But how the government did it in this case was wrong.