In my opinion, Huck acts this way because of his morals. He has better morals than either the Duke or the King do and so he does not want to help rip off any innocent people.
One of the major themes in this novel is how Huck struggles with his conscience throughtout the book. He knows that he should behave like society wants him to, but he has his own morality that he wants to follow.
In this case, he is showing that he really does have good morals.