Lawyers for a group of parents who don’t want their children vaccinated told a state judge in New York Aug. 14 that their First Amendment rights will be violated if they are forced to do so.

More than 1,000 parents and children, dressed in white for solidarity, flooded a courthouse in Albany, hoping Justice Denise A. Hartman will block a law passed in June or at least issue a preliminary injunction. The measure bars unvaccinated minors from school or day care unless they have a medical condition that justifies not getting the vaccine.

The law eliminated exemptions to vaccination requirements...