When it comes to humour, politicians are often the butt of jokes. This can be a problem, however, if the jokes are delivered by a judge.

That seemed to be the message of a ruling this past week by the Utah Supreme Court, which approved a six-month suspension, without pay, for Judge Michael W. Kwan of Taylorsville Municipal Justice Court, after he made politically charged comments in his courtroom about President Donald Trump.

The Supreme Court said in its ruling Wednesday that the comments — along with an online posting in 2016 critical of Mr Trump — violated judicial rules on “independence, integrity and impartiality”.

The court noted that Judge Kwan, who was appointed to the municipal court in 1998 and subsequently re-elected by voters, had previously been disciplined for inappropriate political comments.

“It is an immutable and universal rule that judges are not as funny as they think they are,” the court said.

Most shocking remarks made by Trump at campaign rallies Show all 7 1 /7 Most shocking remarks made by Trump at campaign rallies Most shocking remarks made by Trump at campaign rallies Doctors and mothers killing babies At a rally in Wisconsin in April 2019, Mr Trump made this extraordinary claim. “The baby is born, the mother meets with the doctor, they take care of the baby,” Mr Trump said. “They wrap the baby beautifully and then the doctor and the mother decide whether they will execute the baby” Getty Most shocking remarks made by Trump at campaign rallies "China rapes our country" At a rally in Fort Wayne, Indiana in 2016, Mr Trump said this in reference to the US trade deficit with China: "we can’t continue to allow China to rape our country and that’s what they’re doing. It’s the greatest theft in the history of the world" Getty Most shocking remarks made by Trump at campaign rallies "EU formed to take advantage of US" At a rally for the midterm elections in October 2018, Mr Trump called the EU a "brutal" alliance that "formed to take advantage of us" AFP/Getty Most shocking remarks made by Trump at campaign rallies "I will build a wall and Mexico will pay for it" Mr Trump first made this claim at the launch of his presidential campaign back in 2015: "I will build a great, great wall on our southern border, and I will have Mexico pay for that wall. Mark my words" AFP/Getty Most shocking remarks made by Trump at campaign rallies "Horrible, horrendous people" At a Republican rally in Pennsylvania on August 3 2018, President Trump deemed all journalists in attendance "horrible, horrendous people". He later denounced the "fake, fake, disgusting news" for falsely reporting that he was late to his meeting with the Queen when visiting Britain AFP/Getty Most shocking remarks made by Trump at campaign rallies "I could stand in the middle of Fifth Avenue and shoot somebody" Mr Trump said this in reference to his popularity during a rally in Iowa in 2016 AFP/Getty Most shocking remarks made by Trump at campaign rallies "I wish I could punch him" Mr Trump said this in reference to a protester who was escorted out of his rally in Las Vegas on 22 February, 2016. There was often violence between protesters and supporters at Trump's campaign rallies AFP/Getty

The court added: “Every time a judicial officer engages in misconduct, he or she spends the goodwill of the judiciary as a whole. Here, we readily conclude that Judge Kwan has been spending our goodwill.”

Greg Skordas, Judge Kwan’s lawyer, said the judge acknowledged the Utah Supreme Court’s findings.

But he said the judge liked to make people who appeared before him feel comfortable through levity. “His motives are pure,” Mr Skordas said.

Judge Kwan isn’t the first judge to be accused of violating the axiom that the judiciary should be separated from politics.

A federal judge in San Antonio was suspended in 2016 from conducting naturalisation ceremonies after telling new US citizens that they should “go to another country” if they did not like Mr Trump’s presidency, the San Antonio Express-News reported.

President Trump had also publicly lodged his own complaints about judges’ partisanship, particularly those who had ruled against his administration.

In explaining Judge Kwan’s suspension, the Utah Supreme Court described a January 2017 exchange between the judge and an unidentified individual in his courtroom who was proposing that they paid court fines with money from their tax return.

“You do realise that we have a new president, and you think we are getting any money back?” Judge Kwan asked.

“I hope,” the person said.

“You hope?” Judge Kwan said.

“I pray and I cross my fingers,” the person replied.

“Prayer might be the answer,” Judge Kwan said, “‘cause, he just signed an order to start building the wall and he has no money to do that, and so if you think you are going to get taxes back this year, uh-yeah, maybe, maybe not.

“But don’t worry, there is a tax cut for the wealthy so if you make over $500,000 (£393,000) you’re getting a tax cut.”

The Utah Supreme Court also outlined “blunt, and sometimes indelicate, criticism” that Judge Kwan posted on his LinkedIn profile and private Facebook page in 2016 and 2017.

Fox News' Judge Napolitano says Donald Trump committed obstruction of justice and should be indicted

According to the Utah Supreme Court, three days after President Trump was elected, Judge Kwan posted: “Think I’ll go to the shelter to adopt a cat before the President-Elect grabs them all.”

“Welcome to governing,” Judge Kwan posted in January 2017. “Will you dig your heels in and spend the next four years undermining our country’s reputation and standing in the world?”

Judge Kwan added in the Facebook post: “Will you continue to demonstrate your inability to govern and political incompetence?”

The Utah Supreme Court said Mr Kwan had also violated judicial rules when he lost his temper after a member of the court’s administrative staff had been promoted “without his involvement”.

Mr Kwan then threatened to suspend the clerk, the Utah Supreme Court said.

Judge Kwan agreed that his actions against the clerk were improper and violated judicial rules, according to the Utah Supreme Court. And the court said Judge Kwan also acknowledged that his courtroom exchange was an “inappropriate attempt at humour.”

But with regard to the Facebook posts, Mr Kwan had argued that he was exercising his free speech and that the six-month unpaid suspension was too severe.

Judge in Tennessee faces repercussions after posting racist memes

The Utah Supreme Court said Mr Kwan had acknowledged that at least one of his online posts violated the judicial code of conduct — enough to warrant the punishment.

The court noted that it had publicly reprimanded Mr Kwan twice in the past: once, in 2005, for an explicit reference to President Bill Clinton’s extramarital affair, and another, in 2016, for his service as president of the OCA — Asian Pacific American Advocates, a non-profit organisation that criticised political candidates.

The Utah Supreme Court said Kwan had acknowledged after those cases that a judge should not engage in activity “inconsistent with the independence, integrity, or impartiality of the judiciary.”

“We note that previous endeavours to help Judge Kwan correct this behaviour have not been successful,” the court said. “And we regretfully conclude that a sanction less severe than suspension without pay will suffer the same fate as our prior attempts.”