Did the majority of Union soldiers in the American civil war see themselves as fighting to preserve the union or fighting to end slavery?

by Tiduszk

And did the overall sentiment change over the course of the war?

Georgy_K_Zhukov

Although is is somewhat narrow in its scope, this older answer should be of interest, tracing the intertwined histories of the popular army song "John Brown's Body" and rising abolitionist sentiment within the Federal forced.