Of course if a law violates the Constitution itself, then states can and must resist. But they still can not leave the Union.
Article 1. Section 10. Sentence 1: No state shall enter into any Treaty, Alliance or Confederation. There it is in plain English.