At the beginning of the war, some Union soldiers from border states, such as Kentucky and Maryland, were neutral or even sympathetic to the institution of slavery. However, as the war progressed and Union victories mounted, the influence of abolitionist ideas spread throughout the army, and more soldiers came to see the fight against slavery as a central goal of the war.
The Emancipation Proclamation, issued by President Abraham Lincoln in January 1863, was a turning point in the way Union soldiers viewed slavery. It declared that all enslaved people in Confederate-held territory were free, and it provided a moral and legal justification for fighting to end slavery. Many Union soldiers were inspired by the proclamation and saw it as a sign of the Union's commitment to justice and equality.
As the war continued, Union soldiers often encountered enslaved people who had escaped from Confederate territory or who had been freed by Union troops. These encounters humanized the issue of slavery and helped to motivate soldiers to fight for the freedom of all enslaved people.
Overall, the view of slavery among Union soldiers evolved from a relatively neutral or divided stance at the beginning of the war to a strong anti-slavery sentiment by the end of the war. The experience of fighting for the Union and the exposure to the realities of slavery transformed many soldiers' perspectives and helped to shape the eventual abolition of slavery in the United States.