O. Henry loved a good twist, and he delivers one for the ages here in this story. Instead of getting ransom paid to them, the kidnappers have to pay to get rid of their victim:
You bring Johnny home and pay me two hundred and fifty dollars in cash, and I agree to take him off your hands. (87)
The boys don't even get a sound getaway:
When the kid found out we were going to leave him at home he started up a howl like a calliope and fastened himself as tight as a leech to Bill's leg. (95)
Do you think Sam and Bill learn anything from their mistakes by the end? It's enough to imagine Bill running away with his tail between his legs, defeated by the meaty irony that has dogged him from the beginning of their scheme.
The ending also leaves us with rather mixed feelings. Sam and Bill definitely have this coming, but they also seem like nice enough fellows and this isn't a story with a lot of nice people in it. The irony of that predicament—rooting for the criminals even while understanding that they sort of asked for it—is a big part of why the story works so well. It catches us off-guard and leaves us a little unsure of how we should feel. Great literature doesn't always tie things up in a bow; an ending that leaves us a little torn also helps us think a little more… and O Henry was all about trying to get people to think.