It was about slavery, full-stop. The states’ rights thing was an obvious canard at the time – one of the major complaints of the seceding states was that the Federal government wasn’t sufficiently infringing on the rights of Northern states to not cooperate with the Fugitive Slave Act.
It is true that for many in the North, before the Emancipation Proclamation, their primary war aim was to preserve the Union and the Constitution – but that principle isn’t extricable from the issue of slavery.
Before the Civil War, abolitionists inside and outside of the Republican Party had pointed out that the “slave power”/slaveocracy (whatever you want to call the planter elite) had become fundamentally hostile to the basic principles of republicanism – i.e, majority rule – and were demanding minority rule for themselves. (A big part of Lincoln’s Cooper Union speech was about making this very case.)
Yet another argument of abolitionists had pointed out that the “slave power” had rendered the South un-republican – suppression of free speech through the banning of abolitionist literature and speeches, the use of the 3/5th clause to create malapportioned legislatures that gave a minority of whites in the plantation belt a disproportionate amount of political power, the use of pass systems and slave patrols to limit physical freedom, etc. etc. – and that this went against the precepts of the Constitution. (Hence Bingham’s argument about Article IV Section 2 of the Constitution which he then incorporated into the 14th Amendment)
Thus, there was an argument at the time that, even if your primary aim was to preserve the Union and the Constitution, the “slave power” had to be broken, because it was the major threat to both.