The Civil War armies, both Union and Confederate, tended to be organized as regiments from particular states, and soldiers usually felt their first loyalty toward their regiment.
Soldiers also strongly believed they represented their home state and their local region in the state, and much of the morale of Civil War units was focused on that pride. Each regiment had its own unique flag that it carried into battle.
The regimental battle flags were treated with great reverence, and respect. There were several reasons for this.
The regimental flags were critical in Civil War battles as they marked the position of the regiment on the battlefield, which could often be a very confused place. In the noise and smoke of battle, regiments could become scattered, and vocal commands, or even bugle calls, could not be heard. So a visual rallying point was essential, and soldiers were trained to follow the flag.
Because the regimental flags had strategic importance in battle, designated teams of soldiers, known as the color guard, carried the flag. A typical regimental color guard would consist of two color bearers, one carrying the national flag (a Union flag or a Confederate flag) and one carrying the regimental flag. Often two other soldiers were assigned to guard the color bearers.
Being a color bearer was considered a mark of great distinction and it required a soldier of extraordinary bravery. The job was to carry the flag where the regimental officers directed, while unarmed and under fire, and color bearers had to face the enemy and never break and run in retreat, or the entire regiment might follow. With the regimental flags generally in the middle of the fighting, there was always the possibility that a flag could be captured. To a Civil War soldier, the loss of a regimental flag was a colossal disgrace. The entire regiment would feel shamed if the flag was captured and carried away by the enemy.
As the Civil War continued, regimental flags often became something of a scrapbook, as the names of battles fought by the regiment would be stitched onto the flags. And as flags became tattered in battle they took on new significance.
At the end of the Civil War state governments put considerable effort into collecting battle flags, and those collections were looked upon with great reverence in the late 19th century. While those statehouse flag collections have generally been forgotten in modern times, they do still exist.