From what I read of the decision, it is correct.
States cannot be forced to use their resources to enforce federal law.
The federal government can put requirements on any funds it gives to the state. If the state accepts the funds it has to accept the requirements.
It's also a partial win for the feds. Barring businesses and local police from cooperating with immigration officers were two of the most egregious points the feds were fighting.