Tom has been ordered to whitewash the garden fence by Aunt Polly as punishment for his bad behaviour, and finds this a very hard and boring task. However, he manages to coax first Ben Rogers and then various other boys of the village into doing it for him.
Tom does this in an ingenious way, by pretending that actually whitewashing is a lot of fun, and something that a boy doesn’t get the chance to do very often. This makes Ben and the other boys envious, so that they actually want to do it instead of him. Tom retires in triumph to watch them. Moreover, he gets marbles and various other bits of ‘wealth’ from them, in return for letting them perform this great task.
The author explains what Tom has managed to do:
He had discovered a great law of human action, without knowing it, namely, that, in order to make a man or boy covet a thing, it is necessary to make the thing difficult to attain. (chapter 2)
Therefore Tom succeeds in making the job look like something attractive, so that the other boys will ‘covet’ it, desire it. The incident is a light-hearted one, but Twain uses it to illustrate a larger human truth.
Tom made the job appear as a pleasurable activity. He also pretended that whitewashing was a job for a skilled artist, not just any ordinary boy. Poor Ben was tricked by Tom's act, so much so that he even gave Tom a little token in exchange for being allowed the "privilege" of whitewashing. Mark Twain's message is that when you make something unexciting seem fun and/or hard to obtain, the thing becomes an object of covetion.