Based on what the Federal scout tells Peyton Farquhar in part II of the story, we have to make some assumptions, because we are never told explicitly why this man is being hanged. The Federal scout is "gray-clad," which tells us that he is wearing a Confederate uniform (in the American Civil War, the Confederate soldiers wore gray, while the Union army wore dark blue). This compels Farquhar to trust him, because he believes they are on the same side. The soldier tells Farquhar about how dependent the Union war effort is on the railroads and how anyone who interferes with the railroad "will be summarily hanged" by official army order. This seems to provide clear evidence that the railroads are vital, and so a Southerner who wishes to thwart the Union army could do great damage to it by disrupting the railroad.
Farquhar takes the bait and asks what kind of damage a person could do if he could sneak past the guards at the Owl Creek Bridge (the bridge from which he's being hanged in parts I and III), and the soldier explains "that the flood of last winter had lodged a great quantity of driftwood against the wooden pier at this end of the bridge. It is now dry and would burn like tinder." We can assume that this is what Farquhar did, and because the soldier was actually a Federal scout, he informed his regiment, and they caught Farquhar red-handed attempting to burn the railroad bridge down. Therefore, the scout lied because he was trying to trick Farquhar into acting against the Union so that he would be caught.