US Constitution has supremacy (if it didn't federalism would fall apart). Courts tend to resolve any differences between the state law and federal law, by concluding that as along as the federal government has the power to make the law under the Constitution, and the law doesn't commandeer the state, the federal law wins the day. For instance, in Obamacare the individuate mandate was Constitutional because it's really a tax. However, the law couldn't command the states to use Medicaid to subside the poor, under threat of taking all Medicaid funding. The gay marriage issue has already been resolved by the Supreme Court, as to which set of laws controls, hence the problematic defiance of the Alabama judge.