I typically hate the term 'common sense policy' but I don't think it has ever made sense for cities to blatantly break federal law and expect to receive funding regardless. Good move by the administration. Sanctuary cities are wrong.
It's not an issue of "breaking the law"; the federal government doesn't have the authority to make the local administrations act. Its an issue of cooperation: ICE conducts its Federal immigration duties separately and states/cities choose to spend their time and money helping ICE or not. Sanctuary cities can't stop the federal government from acting within their limits, but they can choose the extent of cooperation they want their own agencies to have with federal authorities.
And the popularity of the move is kind of beside the point; if its unconstitutional it doesn't matter how popular it is, the courts are going to strike it down.