Writing for the majority, Justice Samuel Alito explained the case’s significant First Amendment implications.