Twain clearly uses Huck's tale to showcase the flaws that lie within American society. But I believe that one could make an argument that Huck is a metaphor for America, also. He is a growing boy, an adolescent, in a hostile world, trying to find a way to define himself. This is a great description of the US during the early and mid-19th century. America was still very much a young country. It was still expanding westward and had yet to fully form its identity, as is evident by the intense conflicts over slavery. In essence, America was still a child, a growing child, but a child nonetheless, unsure of its place in the world and what it was about. This is Huck. A child growing into maturity, challenged by the world around him.
Twain takes this character and follows him down a path of growth; this is a path that is just as challenging, conflicting, and confusing as the path that America was on in her adolescence. The slow realization of Jim's humanity mirrors America's slow realization of the evils and hypocrisy that slavery embodies. Just like the call of abolition in the early 19th century, Huck comes to this realization slowly and with much resistance, but as the truth becomes more evident and damning, his realization growns at a greater rate until he is almost completely transformed. But even with this vast transformation, Twain shows that Huck still has a long way to go before he is a fully formed adult. Huck's choice to go off with Tom in order to "rescue" Jim still shows a very great amount of immaturity. His intentions are fine, but he goes about fulfilling them in an improper way.
Finally, Twain leaves Huck in his imperfect state so as to keep the reader wondering how exactly he will end up. Twain does not really resolve this question because he does not know what will happen to Huck. All Twain has is a strong sense of optimism and faith that Huck's goodness and ability to grow will lead him to become a strong, responsible, moral man. And this is the hope that one can only hold for his country.