Before he sent another guilty Chicago alderman to prison Monday, a federal judge acknowledged the harsh punishment meted out over the years to ex-Gov. Rod Blagojevich and other corrupt politicians have “not had the desired effect.”

But to conclude it’s time to stop putting crooked aldermen behind bars because they haven’t ended their crimes is an argument to simply “give up,” U.S. District Judge Jorge Alonso concluded at the Dirksen Federal Courthouse.

So, telling a crowded courtroom it’s important politicians “get the right message,” the judge handed a one-year prison sentence to former Ald. Willie Cochran, who he said has added his name to the “long and pathetic tradition” of Chicago corruption.

Cochran pleaded guilty in March to wire fraud, ending his tenure on the City Council and acknowledging he took $14,000 more than he put into a 20th Ward charitable fund, using the money for personal expenses.

In court, Cochran apologized for his crimes, launching into a campaign-style speech about his family and his good works as alderman.

“I am better than this,” Cochran said, sitting at the defense table in a light-gray suit and tie.

But after the roughly two-hour sentencing hearing ended, Cochran turned defiant in the courthouse lobby. He accused prosecutors of lying and hiding evidence, and he said he was treated unfairly compared to former U.S. Rep. Aaron Schock, who struck a deal that will likely end his own corruption case without a conviction.

“There’s no justice in this,” Cochran told reporters. “I’m not happy about it. My family’s not happy about it. But you know, the fact of the matter is, it’s never going to be right. Not under these circumstances.”

“There’s no justice in this . . . It’s never going to be right,” Ald. Willie Cochran said.

U.S. Attorney John Lausch said Cochran had his facts wrong about Schock, and he insisted that prison time continues to send a message to politicians “who may be tempted to go over the line.”

“We have a very stubborn public corruption issue in the city of Chicago,” Lausch said.

Mayor Lori Lightfoot, a former federal prosecutor, did not hold back in condemning the sentence for Cochran, calling it “embarrassing” and “effectively a slap on the wrist.”

Lightfoot called the sentence “shameful. And I think it sends all of the wrong messages.”

The question of sending pols to prison surfaced in the weeks before Cochran’s sentencing after his attorney, Christopher T. Grohman, argued that Cochran should be spared prison time in part because it “has not done anything to curb Chicago’s tidal wave of aldermanic corruption cases.”

He made the argument just as federal authorities appear to be burrowing deeper into City Hall through multiple corruption investigations.

Grohman stood by the argument in court Monday, insisting there is no evidence that jail deters crime. But Assistant U.S. Attorney Heather McShain attacked the notion as “utterly irrational,” “offensive” and “bizarre.” She said it would send the message that public officials are given the “kid-glove” treatment when they ask for it.

Cochran’s attorney has said the former alderman began to dip into the charitable ward fund after his wife became ill, straining the family’s finances. His gambling trouble only exacerbated the situation — McShain said Cochran spent “hundreds of hours in casinos” while in office — and he thought he could recoup $37,500 of his own money that he had kicked into the fund.

Ultimately, Cochran admitted he took out $14,285 more than he put in.

A court memo filed earlier this month listed several expenditures from the charitable fund during Cochran’s fraud, which took place between January 2010 and April 2014. They included nearly $25,000 in ATM withdrawals at casinos; $6,100 in payments for his daughter’s Eastern Illinois University tuition account; $1,100 for meals at McCormick & Schmick’s, Chez Joel, Hugo’s Frog Bar & Fish House and Ditka’s Restaurant; $1,350 at Z Gallerie; and $314 at Crate & Barrel for kitchen items, many of which were later found during a search of Cochran’s home.

Another $71 was spent on a fog lamp chrome bumper ring for a Mercedes.

Cochran now follows in the footsteps of his predecessor, former 20th Ward Ald. Arenda Troutman, who went to prison for shaking down developers. Cliff Kelley, another former 20th Ward alderman, was also among five aldermen caught up in a bribery scheme.

Meanwhile, federal authorities last week raided the ward office of 34th Ward Ald. Carrie Austin amid an investigation that appears to revolve around the purchase, construction and financing of her home.

And late last month, the feds hit 14th Ward Ald. Edward M. Burke with a blockbuster 59-page racketeering indictment. They built the case against him with the help of former 25th Ward Ald. Danny Solis, who faced his own corruption allegations but has not been charged with a crime.

Contributing: Fran Spielman