Both sides were fighting for different kinds of freedom. They both rallied around their flag for support. Both sides loved the places they were from and wanted to fight so that these lands would remain theirs. I think that they wrote the songs to inspire their troops so that they would fight hard and win the war.
The two sides were fighting for two different kinds of freedom. The Union side was fighting to free the slaves. In the song it said that the Confederate side was fighting for freedom from the Union. The Confederates wanted to make their own country where they could own slaves. The Union wanted to make the Confederates part of the Union again and form one unified nation. The South didn't want to be part of it.
Both sides rallied around their flag for support. In one of the Union songs they said that they would rally around the flag. They said that the Union flag will wave. A Confederate song says that their flag is always streaming. I think that soldiers on both sides took great pride in their flag and that the flag became a symbol of what they were fighting for.
I think that these songs were written to inspire the troops to win the war. I think that each side wanted their men to try harder and thought that the songs would help them do it no matter how bad things got. The men who heard the songs did get inspired by the music and the words, so that they would do better in a battle. I also think the songs helped to get the soldiers' spirits up when times were hard. I believe that the songs had a big impact on the way soldiers felt and fought during the civil war.