I thought the feds did this all the time with highway funds and such. Seems not only constitutional but downright routine?
Yeah, they do this all the time. I'm wondering what precedent there is to it, but I'll have to do some searching to find it (will possibly update this post soon).
Edit: Five minutes of searching has answered my question. I'll try to summarize briefly, but for the proper explanation, see 5(a-b) of the opinion itself. Congress cannot require states to regulate, but can (and often does) offer incentives as part of a program of cooperative federalism (see New York vs. United States for relevant precedent). As such, completely withholding existing Medicaid funds (a program in which states have already agreed to participate) constitutes coercion to participate in the new program, as the state doesn't really have an option (they'd be too crippled if their federal funding for Medicaid suddenly disappeared). It was argued that the expansion merely amends the existing program and so isn't an issue, but the Court rejected that analysis.
Note that the only unconstitutional part is the coercion - the expansion itself, should states choose to participate, is not a problem. And as far as I can tell, Congress could still offer "incentives" in the form of withholding some funds, so long as that doesn't effectively require states to join in by making the option of opting-out unbearable.