The joke in law school is that "A" students become defense attorneys, "B" students become prosecutors, and "C" students become judges.Judges have to be lawyers, which costs lots of money, so have to be capitalist, wealthy elite.
Judges tend to be the cream of the crop, so are the least corrupt.