The duke gets sour at the king because the king managed to lie himself into a higher rank than the duke. After Huck witnesses the Grangerford-Shepherdson feud, maybe as a result of witnessing it, he becomes very wary of human conflict, actual and potential. In his ideal society, people would be kind toward one another. Even though he knows that the duke and king are con men, he doesn’t expose them, because they seem harmless and because exposing them may only cause unnecessary conflict.