At the end of "The Devil and Tom Walker," as Tom has vanished, apparently taken by Old Scratch, the narrator warns "all gripping money-brokers" to "lay this story to heart." This is the most important theme of the story. Both Tom and his wife are portrayed as miserly people, obsessed with material gain to the point that they hid money and even freshly-laid eggs from each other. Tom does actually reject the devil's first offer, primarily because Old Scratch demanded that the money be invested in slave trading (a none-too-subtle critique of the institution of slavery), but his wife immediately tries to deal with the devil herself.
Once he has bargained with the Devil, Tom becomes a merciless moneylender, gouging poor Bostonians in a time of economic depression and a general shortage of currency. He is a usurer, one of the Devil's "peculiar people." He becomes rich and prominent, but eventually begins to despair that the Devil may in fact collect his due. This is why he attends church, though even that is an act of cheating. He becomes a zealous and highly judgmental churchgoer, one who views the sins of others as "a credit on his own side of the page." His Christianity, in short, is highly selfish, and "his zeal became as notorious as his riches."
Of course, this story has much to say about fake morality, but its main theme, that of greed, might be best understood in light of its context. America in the 1820s was in the early stages of what has been called a "market revolution," a rapid change to market capitalism that fundamentally altered traditional economic and social relationships. Though Irving was in Europe while writing this story, he had experienced these wrenching economic changes firsthand, as his family business was ruined. Irving and many other intellectuals—the transcendentalists of the following decades would take up similar themes—bemoaned what they saw as a grasping, overly materialistic culture emerging in the new United States. "The Devil and Tom Walker" is entirely consistent with these concerns.