I agree the outcome was correct, but I think you may misunderstand how this got to the Supreme Court:
1. The NRA sued this official for First Amendment rights violations.
2. It went up through the courts, but importantly, the NRA lost in the Second Circuit.
3. The NRA then appealed that loss to the Supreme Court.