Some things that may surprise you, if you haven't heard them before:
2 million people were enslaved by the 1840s. They comprised about 1/3 of the South.
Many of those who didn't own slaves or belong to slaveholding families (which were a majority) still supported slavery because it defended their way of life, was something they aspired to (they wanted to become rich and own slaves), and wanted to maintain social order as they saw fit. They, despite forming a majority of the electorate, never even tried to get rid of slavery.
1/3 of families in the South owned slaves.
Knowing this, it is very hard for anyone to make the argument that Confederate soldiers weren't fighting for the right to own slaves.
Many were fighting to preserve the way of life (slavery), if they weren't fighting on behalf of slaveowners (if they were paid to do so, as sometimes happened), fighting to keep the North out of their affairs (once more, because the South perceived slavery as threatened), or fighting to support slavery in their family.
Source: Becoming America, Dr. D. Henkin
I'm from the South as well... I was told the same thing; that the average southern white was fighting for states rights, not slavery.
As I've studied the civil war I have come to believe that the average confederate was fighting more to preserve their own way of life. Getting rid of slaves would devastate the southern economy, and take down whites of all socioeconomic statuses with it. Along with that most southern whites couldn't stand the idea of blanks being equal to rights, even if they didn't believe in slavery. So they might have been fighting for that too.