They ruled (on page 44 of their decision) that the commerce clause and the "whatever other" clause they wanted to use do not apply, but that the tax clause does.
This is both good and bad. Bad in that it means this horrific law stays around. Good in that now Congress can pass a law removing the tax from this law.
unfortunately (or fortunately, depending on your POV), we have a precedent set of the President deciding he can ignore laws, so there's not much to stop the next conservative POTUS (whoever that may be) to simply decide not to tax or go after anyone who chooses not to follow the law.
look forward to Obamacare waivers issued for all 50 states next time there's a Republican in the White House.