Farquhar was a Southern planter with obvious interest to protect in the South, so naturally he supported the Confederacy. When a Confederate soldier stops by his plantation one day, Farquhar helps him develop a plot to burn down the Owl Creek Bridge. He informs the soldier how easy it would be to burn because of a large amount of drift wood piled underneath it.
Later, we learn that the Confederate soldier was actually a Federal scout. Farquhar’s plot to burn the bridge to prevent the infiltration of the Union is his crime and the reason for his execution.
The situation in this story is that the Union army has invaded deep into the South. They have gotten near to Farquhar's plantation. He does not like this and he wants to do something to fight back against them.
What Farquhar does is to try to sabotage the bridge that crosses Owl Creek. According to the laws of war, it is illegal to try to commit sabotage unless you are in the uniform of your country's armed forces. Otherwise, you are a spy and you are liable to be executed.
Of course, the guy who egged Farquhar into doing it was committing an illegal act since he wasn't in uniform, but he didn't get caught.