Huck's dialect is reflective of Twain's use of regionalism and local color in his writing. He populates his work with characters who speak like the locals would have actually spoken in that area. This is much the same as modern-day writers who use urban slang in their works to give their characters a "street" quality or the use of "country" dialect to represent characters who live in rural areas. When a writer chooses to use improper grammar and phonetic spellings of words such as Twain does, the writer is making the characters more realistic. An uneducated youth from a small southern town is not going to speak like a Harvard educated English professor! Had Twain used "standard" English, he would not have achieved the same effect with his characters. Readers would have gotten to know them for what they said, but not for who they really were (or who they actually represented).
Yet Huck is still on a slightly higher level than his pap. Huck states:
If I never learnt nothing else out of pap, I learnt that the best way to get along with his kind of people is to let them have their own way.
He uses some regional dialect (learnt nothing else out of) but nowhere near as much as his "pap" uses:
Who told you you might meddle with such hifalut'n foolishness, hey?
says his pap about Huck's attempts at education. Could you imagine if his father had said: "Who encouraged you to think that the pursuit of education was within your reach?" for example, it just wouldn't sound the same!