Huck considers right and wrong throughout the story. He actually begins by discussing lying, saying, “I never seen anybody but lied one time or another.” He is trying to determine for himself what is moral and immoral. In chapter 28, Huck considers that the truth may sometimes actually be easier than a lie:
I says to myself, I reckon a body that ups and tells the truth when he is in a tight place is taking considerable many resks, though I ain't had no experience, and can't say for certain; but it looks so to me, anyway; and yet here's a case where I'm blest if it don't look to me like the truth is better and actuly SAFER than a lie.
He ends up deciding that it is ok to lie sometimes. He comes to the conclusion that it is better to do what he personally thinks is right than to do what society thinks is right. Huck thinks that society's rules are hypocritical, which is why he decides to help Jim, and he and Tom do their “evasion” to protect him. When Huck says, "All right, then, I'll go to hell," he is determined to make his own morality, and not society’s.