"The Bet" might not actually have anything to say about the death penalty, but it can certainly be read as an experiment in solitary confinement. Sure, most prisoners are fairly deprived, but how can you figure out the effects of total isolation, rather than plain old confinement? Here, a prisoner has all the physical and intellectual comforts that he could want, but he's cut off from any and all human contact. What follows is the psychological transformation of an already slightly unbalanced man into a being that loses all touch with his own humanity. Yikes.
The story shows that isolation is the one surefire way to get someone to shed most of their humanity.
True isolation—no books—would have actually been better for the lawyer in the long run. He would have missed and sought out human companionship instead of just rejecting the world outright. See? Books are bad news.