Unless a federal law violates the federal constitution states can absolutely be compelled to enforce it. See the supremacy clause of the U.S. constitution (Article VI, Clause 2).
Unless United States supreme court finds the issuance of immigration detainer’s unconstitutional The supremacy clause applies and the federal government can force states and counties and municipalities to honor them. Furthermore the state and local entities cannot argue that it is an unfunded mandate since reimbursement for the detention of illegal aliens is provided through the SCAP reimbursement process.
https://www.bja.gov/ProgramDetails.aspx?Program_ID=86
What we have seen so far is a few left leaning activist judges have the process unconstitutional. Whether Those decisions or the recent state of California sanctuary law would survive a constitutional challenge at the U.S. supreme court is another matter.