In getting the materials to break Jim out of his shed, Tom and Huck steal various tools and materials from around the household. Both of them understand that they are stealing things that do not belong to them, but they justify it for different reasons. Tom believes that they are allowed to steal without moral quandary because they are acting for criminal intentions; he thinks that admitting to criminal behavior negates the sin of stealing.
He said we was representing prisoners; and prisoners don't care how they get a thing so they get it, and nobody don't blame them for it, either. It ain't no crime in a prisoner to steal the thing he needs to get away with, Tom said; it's his right...
(Twain, The Adventures of Huckleberry Finn, gutenberg.org)
However, when Huck steals a watermelon for his personal use from the slave vegetable patch, Tom gets angry because this is not a "necessary" crime. Huck fails to see the semantic difference between the crimes; he thinks that stealing is stealing, regardless of the justification. This shows that Tom is less ethical than Huck: Huck doesn't try to excuse his anti-social or criminal behavior, while Tom thinks he can escape the system through excuses and loopholes.