The judges in the novel can be taken to represent Huck's moral conflict, which pits individual conscience against society's codified morality.
Judge Thatcher accepts Huck's money early in the novel because he understands Huck's situation with Pap Finn and wants to help. In order to accept the money as a pretense, Judge Thatcher has to really, legally take it. This constitutes a "bending" of the rules as Thatcher has no apparent intentions of actually keeping the money for himself. Effectively, the judge agrees to Huck's deception, which is a plan to deceive without the need for explicitly lying.
This action from Thatcher shows that morality can be enacted outside the law. Deception can serve virtuous purposes. The moral line is not written by the law in this case, but by circumstances. (Huck finds that he has to follow the same principle in deciding to save Jim from captivity at the end of the novel.)
The next judge, however, stands as a representative of the unyeilding claims of society on the right of moral judgement.
[Judge Thatcher] and the Widow Douglas petition a higher court to take Huck away from his father, but the court's "new judge" says families shouldn't be separated.
The social dictum stated here reinforces the idea that law, not circumstances, must determine right from wrong; moral from immoral. Huck struggles against a sense that this authority is unavoidable and often irreconcilable with his own conscience.
The judges then, in their opposition, can be seen as representing Huck's moral conflict (and the novel's primary interest) in determining how moral behavior is defined - by who and by what means.