Comedy
This is truly a story about the folly of man. Every step of the way we see Sam and Bill commit tiny blunders with Johnny. They see the clues of what's to come, such as when they spy Johnny "throwing rocks at a kitten on the opposite fence" (7), but plow forward regardless. Man plans, God laughs: that's the essence of comedy, and by looking at it through the eyes of these hapless criminals, we can see how our own blunders and general idiocy play out the same way.
How? O. Henry uses a couple of specific tricks. First of all, there's the whole notion of how "easy" this is supposed to be.
Summit couldn't get after us with anything stronger than constables and, maybe, some lackadaisical bloodhounds and a diatribe or two in the Weekly Farmers' Budget. (3)
Of course, it turns out to be anything but, which overturns the established expectations while reminding us of times in our life when we thought it was going to be smooth sailing as well.
The story also embraces another classic comedy trope: the blundering criminal. Americans pride themselves on their work ethic, and we firmly believe that hard work leads to prosperity. Sam and Bill are trying to job that system, looking for "two thousand dollars more to pull off a fraudulent town-lot scheme in Western Illinois with" (3). They're breaking the law in order to facilitate another criminal enterprise down the road; they're taking shortcuts to get rich instead of working hard like they're supposed to.
In light of that, we get a great deal of joy in watching the pair get taken down. They totally deserve what happens to them and the poetic justice in their predicament makes for very funny material… Even if we have to quietly admit to ourselves that sometimes we wish we could get rich quick just like they do.