MSNBC host and former ad exec Donny Deutsch scammed a real estate broker out of a $1.2 million commission in the sale of Deutsch’s $30 million Hamptons home, a Manhattan judge seethes in new court papers.

Justice Charles Ramos says Deutsch’s lawyer was acting on his client’s behalf when Sotheby’s broker Edward Petrie was schemed out of his 4 percent commission, The Post’s Julia Marsh reports.

After Deutsch realized he knew Marks, he went behind Petrie’s back and brokered the sale privately to avoid the fee, Petrie claimed.

“This court considers that and refusal to acknowledge [Petrie] as the broker to be marks of dishonesty and greed,” Ramos writes in the Oct. 23 decision awarding Petrie’s employer, Sotheby’s, $1.2 million.

“Both characteristics are particularly unbecoming when exhibited by those blessed with great wealth,” the judge scolds.

A representative for Deutsch says, “Mr. Deutsch is shocked and outraged by this ruling, which is wrong based on law and fact. The ruling was based on the Sotheby’s broker’s contention that Mr. Deutsch agreed to a 4% commission arrangement. This is an outright and absolute lie. There was no such agreement, neither verbal nor written, and internal Sotheby’s email communications confirm this. Mr. Deutsch will vigorously defend his position in court and is very confident this decision will be reversed on appeal.”