"An Occurrence at Owl Creek Bridge" is all about a civilian being hanged for a crime during a time of war – without a trial. During the American Civil War, both the Union and Confederate governments enacted martial law at different times and in different places. This meant that the military could temporarily enforce rules and laws in certain areas. As you can imagine, many people were unhappy with this situation. Southerners in conquered states did not take kindly to Union soldiers telling them what to do. And there was a big to-do in the North when President Lincoln suspended the writ of habeas corpus (the right to not be unlawfully imprisoned). So justice and judgment, especially in relation to civilians, were very important issues during the war, and Bierce explores these issues in "An Occurrence at Owl Creek Bridge."
Farquhar deserves to be executed since he disobeyed a rule and attempted to burn down a bridge.
Farquhar's sentence is too harsh. He doesn't deserve to die as punishment for trying to burn down a bridge, especially because he is a civilian and not a soldier.