Many Slaves did serve the Confederacy. They considered themselves Southerners. It was their homes and families being effected by the war. They often referred to the civil war as the ‘war of Northern aggression’. Their own words are found here:
Testimonies of Freed Slaves, A 1937 WPA project. Records prepared by the Federal Writers’ Project 1936-1938 assembled by Library of Congress Work Projects, Admin. Dist. Of Columbia
http://www.gutenberg.org/browse/authors/w#a3906
“Many slaves did serve the Confederacy” You seem to think that all blacks were slaves. There were a lot of free black business owners in New Orleans when it was attacked by Union forces. They defended the city against General Butler, who eventually captured and occupied New Orleans. But they tried valiantly to defend their city.