A law making this clearly illegal would be a good call imo.
While I agree with you it is SAD that there is a need for such a law. Barry, IMO, is much to blame for this - he is the one who immediately set the precedence and the tone once he was elected by declaring to the American people that his administration would NOT enforce existing law - specifically DOMA - because HE did not agree with it.
Once he declared that and followed through with it, he made it clear to the American people that the nation under him would NOT be ruled by the Constitution or the Rule of Law but instead by what HE agreed with and did not. Basically Obama declared early he was a despot and would rule the country as such...which is pretty much what he did.
Sanctuary cities are just following his lead - they don't agree with the law / laws so they simply do not comply. So far there has been no repercussions for them doing so. To end it there HAS to be repercussions!