The "guy who got hung" was Peyton Farquhar, the protagonist of Ambrose Bierce's classic short story, "An Occurrence at Owl Creek Bridge." Farquhar is an Alabama plantation owner who has undertaken a mission of espionage for the Confederate (or Alabama) government, presumably to burn the Owl Creek Bridge. Farquhar has dreams of eventually serving in the Confederate army, but he has undertaken this mission since
No service was too humble for him to perform in the aid of the South, no adventure to perilous for him to undertake if consistent with the character of a civilian who was at heart a soldier, and who in good faith and without too much qualification assented to at least a part of the frankly villainous dictum that all is fair in love and war.
However, Farquhar unwisely reveals his intentions to burn the bridge to a man dressed as a Confederate soldier, but who is actually a Federal spy. Farquhar is later captured and sentenced to hang.
In the opening sentences of Part 2 of "An Occurrence at Owl Creek Bridge" the narrator explains Peyton Farquhar's occupation.
Peyton Farquhar was a well to do planter, of an old and highly respected Alabama family. Being a slave owner and like other slave owners a politician, he was naturally an original secessionist and ardently devoted to the Southern cause.
Farquhar is the owner of a large tract of land inherited from his forebears. He is not a subsistence farmer but a "planter." He grows a single crop for sale and has black slaves to do all the back-breaking work. The crop is undoubtedly cotton. The whole Southern economy and society depended on the export of cotton. Most of it went to England where it was turned into cloth in the spinning mills. During the Civil War the Union tried to strangle the South by blockading Southern ports and stopping the export of cotton. This not only hurt the South but hurt the English textile makers. The South hoped that England would assist them in the war against the North. But the English decided it was more prudent to remain neutral rather than risk making enemies of the Northern Yankees. There were many prosperous Southern gentlemen like Peyton Farquhar under the old slave system. Their luxurious lifestyles were entirely dependent on slave labor. It was easy to make money if they didn't have to pay their workers. This factor largely explains why the South put up such a long and bitter fight against the hated Yankees. Naturally the Southern aristocrats thought that slavery was a benign and sensible institution. In fact they wanted to spread that system farther and farther to the west.