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.
Rich people died in that war too, among them, a great man, one of the greatest who has ever walked this planet, of course, I'm referring to Stonewall, tragically struck down in battle by the misguided bullet of one of his own men.