If the war was over slavery, why did thousands of Southerners fight barefooted, armed with squirrel rifles, in freezing weather so a few rich folks could keep their slaves? It was much more than slavery.
The same reason that poor soldiers have been dying for rich people forever. Because their political leaders told them it was the right, Godly and patriotic thing to do. Because their economy depended on it, even if they didn't personally own slaves. Because they had already joined the army and invested too much blood and sacrifice to quit when it got terrible. Because they saw Northerners as invaders.
But, from Bloody Kansas to the Missouri Compromise to the 3/5ths provision of the Constitution itself, it is no use denying that slavery was the root cause of the North/South division. It was the underlying schism of the two cultures.