Tom envies Huckleberry Finn because he is an outcast.
Huck is the son of the town drunkard, but he is essentially an orphan. The reason most of the mothers don’t like him is the very same reason most of the boys do.
Huckleberry was cordially hated and dreaded by all the mothers of the town, because he was idle and lawless and vulgar and bad— and because all their children admired him so, and delighted in his forbidden society, and wished they dared to be like him. (ch 6)
Since Tom is not allowed to play with Huck, he tries to play with him every chance he gets. Huck is able to go wherever he wants and do whatever he wants. While Tom has to go to school and church, Huck has no one to answer to. Tom is a “respectable boy,” while Huck gets to go around in rags.
Despite his reputation, Huck is not actually a bad kid. He is just alone, and has no one to take care of him. He has been this way for so long that he actually prefers it, finding civilization and its rules and limitations uncomfortable.