Judge Thatcher and Widow Douglass are the dynamic duo fighting for Huck’s safety and well-being at the start of the novel. The judge is super-respectable and seems like an all-around good guy. At the end of the Adventures of Tom Sawyer (this novel’s prequel), the judge takes the money that Huck and Tom found during their adventures and invests it for them, so they will earn as much interest as possible.
Judge Thatcher and Huck have a father-son relationship, and when Huck gets worried something bad is about to happen to him, he literally runs to the judge and tries to make the judge take his money. Judge Thatcher won’t have any of that, though; he slyly tricks Huck into not giving away his loot. This says a lot, since most of the other characters in the book would take the money and sprint away in the opposite direction.
Besides taking care of Huck’s money issues, the judge tries to gain custody of Huck when Pap proves to be an incapable father. It seems, to us, that the judge has only Huck’s best interests at heart.