Because the federal government operates under the principle of delegated / reserved powers. States do the delegating / reserving. This isn’t a “federal law trumps state law” question at all. The Civil War did not end slavery in the US. All during and after the war slavery remained legal in Missouri, Maryland and Kentucky because they sided with the Union. Specifically, the US Constitution did not grant slaves full “person-hood” . The Constitution had to be amended to grant full status to former slaves. Additionally, slavery was economically beneficial to many northern states since the “slave” states generated about 63% of the federal government’s income through excise taxes so prior to the war there was no enthusiasm for an amendment. Finally, Lincoln was prepared to assure slavery’s continuation prior to Fort Sumter if the seceded states rejoined the Union. Does that help?