Tom's late confession that Jim was free "all along" seems to side-step the moral issue that Huck has been grappling with. Though Huck does decide to act on his moral instincts and go outside of conventional behavior in doing so, he does not, finally, have to square his own or Tom's behavior with conventions and social norms.
This fact seems in keeping with the "adventure" genre, so I'm okay with it.
Tom was much more concerned with structuring the adventure of helping Jim "escape" for the sake of his own entertainment than with being a kind or considerate person. He put Jim through a great deal of unnecessary torment for the sake of doing things "the right way" when the "right" thing to do would have been to confirm Jim's freedom as soon as he learned of the situation. Tom was a product of his environment, not nearly as capable of thinking independently and reaching a personal conviction as Huck did.
I, too, read The Adventures of Tom Sawyer before reading The Adventures of Huckleberry Finn, and I also found Tom much more likable in the first novel. Tom did not consider Jim as an equal nor was their relationship as close as between Huck and Jim. Tom's decision didn't really surprise me that much, however, since Tom's complicated games and strategies often brought danger to others.
Some critics have argued that Jim at the end of the book is in the same position as many African Americans after the end of the Civil War: technically free but not yet truly free. I agree with earlier posters that Tom emerges from this book as a much less morally appealing character than Huck. Perhaps that was part of the point of the ending: to show the contrasts between the maturity of one boy and the immaturity of the other.
By the end of the book, I end up not liking Tom much. I read Tom Sawyer before I ever read Huck Finn and I really liked Tom in that book. But by the end of this book I got tired of Tom. He was too caught up in his games and he doesn't seem to care that he is messing around with other people's actual lives.