You are quite correct that freeing slaves was not the primary, or initial, motivation of the Federal government in the War Between the States. However, it is also a fable to deny that the primary motivation for Southern secession was the protection of the institution of slavery and the protection of their agrarian economy.
Many in the Confederate military had admirable records before the WBTS (or, as I like to call it, the War for Southern Independence). Many in the Confederate military made a difficult choice between their home State and their Country. It should be remembered that the concept of the American "nation" was not as understood by those who lived in the 1850's as those who lived after the WBTS.
Slavery was an unfortunate aspect of the Nation's history, but to fail to recognize the accomplishments and contributions of the slave-holding Founding Fathers, Framers of the Constitution, and other Southerners who lived prior to the WBTS smacks of political correctness.
Those today who rail against everything related to the CSA not only misunderstand the history of the country, but they also forget the intent of Lincoln's second inaugural address.