The ending of this excellent novel is actually quite ironic in some ways. We may have thought that after all of his adventures, Huck might be ready to settle down and be part of "society" again, after his flight from it that takes up the central section of the novel. However, we need to remind ourselves that one of the central themes of the novel is the conflict between nature and civilisation or society. As Huck and Jim voyage down the river they meet many different examples of society that disrupt their blissful and peaceful lives with nature - the wreck of the Walter Scott, the Grangerfords, the Duke and the King to give just a few examples. Each of these meetings with society only reinforce to Huck how crazy and stupid the rules of society are - he has only seen bad examples of self-serving, hypocritical and puzzling individuals who do not live by the same morals and values that Huck himself has developed. In fact, if we trace Huck's moral development we see that he positions himself in terms of his moral foundation often outside the norms and values of the society of his time. We can see this when he begins to view Jim as a person and a friend, rather than just a "nigger." Thus, at the very end of the novel, it is no surprise that, in response to Aunt Sally's remarks about adopting him, that Huck wants to escape society and civilisation yet again:
But I reckon I got to light out for the Territory ahead of the rest, because Aunt Sally she's going to adopt me and sivilize me, and I can't stand it. I been there before.
It ends the way it does because the ending ultimately implies a return back to the initial stage. It's like The adventure of Tom Sawyer and the symbolic meaning of the river in it. Even though Mark Twain criticizes the insitution of slavery through subtle use of irony, he ends his novel in such a way that signifies a return to the beginning. It seems to me that Mark Twain tried to reveal, if not emphasize his disagreement with his contemporary society in which people were classified into different levels of importance and of standing. The frustration that he renders via his ending amplifies his message about the society. No matter what Huck Finn and Jim do they are back at the same point they started.