The Adventures of Tom Sawyer is a bildungsroman, or a coming of age story. Twain is telling the story of how Tom grows from a young, naive boy into a worldly wise young man. By the end of the story, Tom is entering adulthood. He and Huck have discovered the treasure, and it has been invested for them. Also, the Widow Douglas announces that she plans to adopt Huck. To make "civilized" life more appealing to Huck, Tom promises that they'll have more adventures in the future as robbers, but they have to become respectable first (so they won't be suspected?).
Twain answers your question himself in the conclusion:
SO endeth this chronicle. It being strictly a history of a BOY, it must stop here; the story could not go much further without becoming the history of a MAN. When one writes a novel about grown people, he knows exactly where to stop--that is, with a marriage; but when he writes of juveniles, he must stop where he best can.