associate justice anthony kennedy delivered the opinion of the court, which chief justice roberts, justice scalia, justice thomas, justice alito, and justice sotomayor joined. the court held that the law violated the first amendment and affirmed the judgment of the court of appeals.