The Court found that it was too coercive.
Legal experts are saying that this ruling would likely apply to Jeff Sessions' attempts to defund sanctuary cities:
I am amused.The Trump administration announced this week that it will make good on its January threat to claw back funding from so-called sanctuary cities that limit information-sharing with federal immigration officials. Yet hundreds of legal experts say the move would itself be illegal—in part due to a court ruling Republicans cheered just a few years ago.
In 2012, the Supreme Court forced the Obama administration to make Medicaid expansion voluntary for states instead of mandatory, ruling that when the federal government “threatens to terminate other significant independent grants as a means of pressuring the States to accept” a federal policy, it is unconstitutionally coercive.
Conservative groups that celebrated this victory over "infringement on state sovereignty by the federal government" may now be dismayed to learn that it could throw a wrench into the Trump administration's current plan to punish sanctuary cities.