A judicial ruling is separate from a law, and it's actually quite common for judicial rulings to be found non-constitutional (or even struck down by a normal higher court, if we're talking in general and not this particular case). In particular, only judges are bound by precedent, and even then, only precedent from their own circuit, not the entire USA. Whereas laws made by contract are binding on everyone, and they apply federally.