A wave of sanity has finally hit some judges, legislators, and medical professionals on the issue of vaccination and the enforcement of effective standards for protecting the public from disease. Years of false claims against immunization, which led directly to the revival of certain diseases and terrific damage, have finally resulted in a backlash against those who refuse to immunize children against communicable ailments like mumps, measles, and whooping cough.

What's maddening is that while vaccines are just about the only area of family life in which the government should properly take an active role, it was also seemingly the only area in which the state instead took a hands-off approach, letting parents follow crackpot theories, with predictably awful consequences not just for their own children but for others as well.

First the good news. A federal court has upheld California's repeal of the "personal belief exemption"—an important tightening of restrictions on who can reasonably refuse to vaccinate their children. Along with repealing the personal and religious belief exemptions, California's updated vaccination mandate went into effect on July 1. Children must now be vaccinated to enter public or private school or enroll in daycare. The law still allows for bona fide medical exemptions from these mandates.

Meanwhile, the American Academy of Pediatrics (AAP) has issued a strongly worded new policy statement opposing any nonmedical reasons for refusing vaccination and declared it the right of pediatricians to request that parents seek care elsewhere for their children if, after counseling, they still refuse to vaccinate.

The court, the state government, and the AAP make a great deal of sense. "Parents, pediatricians, and policymakers all have a role here in protecting children from diseases like measles and whooping cough," said Benard P. Dreyer, president of the AAP, about the group's stricter position. "No child should have to suffer through a disease that could have been prevented by a vaccine."

The court upheld the vaccination mandate because in Whitlow v. California it found a compelling government interest "in fighting the spread of contagious diseases through mandatory vaccination of school-aged children." And isn't this exactly the role of reasonable government: to protect citizens, especially those too young to protect themselves, from a foreseeable and eminently preventable danger?

Over the past decade the effort to delegitimize vaccination moved from medical journals (research now completely discredited) to Hollywood and similarly wealthy, overeducated enclaves. Illnesses like whooping cough, which had all but disappeared, returned in such force that a single unvaccinated individual visiting Disneyland in California, in December 2014, caused a measles outbreak that afflicted more than 125 people in seven states. The Centers for Disease Control report that those infected ranged in age from 6 weeks to 70 years of age and that 22 people were hospitalized. This and other outbreaks are what pushed legislators in Sacramento to enact their new standards.

What has the medical community learned? "It's clear that states with more lenient exemptions policies have lower immunization rates, and it's these states where we have seen disease outbreaks occur as the rates slip below the threshold needed to maintain community immunity," said Geoffrey R. Simon, lead author of the medical exemptions policy statement and immediate past chair of the AAP Committee on Practice and Ambulatory Medicine. "Nonmedical exemptions to immunizations should be eliminated."

The bad news is that even with multiple measles outbreaks around the country (not to mention whooping cough and mumps), the campaign to discredit vaccination has been far too effective. According to a survey of pediatricians, conventional wisdom has shifted in the wrong direction. An AAP survey found that 74.5 percent of pediatricians in 2006 had patients who had refused vaccines, a figure that had increased to 87 percent by 2013. The AAP reported that the overwhelming reason parents refuse vaccinations for their children is a growing belief that they are unnecessary.

The reason government has every right to exert its considerable influence and blunt-force power in making parents immunize their children is because without an almost complete rate of vaccination—95 percent of the population or more—we lose so-called herd immunity, which protects even the unvaccinated from communicable diseases like measles and mumps. And while there are some risks associated with vaccines, such as allergic reaction, the benefits far outweigh the risks. "We can say with more confidence than ever that the risk from vaccines is much less than the risk we're preventing," explained Dr. Mark Sawyer, an infectious-disease expert at Rady Children's Hospital in San Diego.

What's infuriating is to realize how quick government and even the AAP have been to intervene against personal choices by families in areas where there is no public-health danger and where the risks are so small as to be statistically nonexistent. In the most extreme example of state power intruding into the private lives of families, children have been removed from the custody of their parents because they are obese. Unlike measles, obesity is not contagious, and yet the state behaves as if the risk is comparable. Parents have been criminalized for allowing their children to walk, play, and sit, both outside and inside, while unattended and unsupervised by an adult. Even though the risk of harm to children from playing in the front yard or walking to the playground is statistically insignificant in this age of low crime rates, the state has deemed the risk of potential harm too great not to react.

Dressers, teething toys, bikes, sippy cups, adult desk toys, baby seats, cribs, and yoyos are among the thousands of consumer products that have been recalled by the government for the risk of harm to children, even when the risks of harm are unproven or when there's been no injury at all. Games and sports like running, sledding, tag, dodgeball, football, and lacrosse have been banned in public schools and playgrounds for the potential risk of harm.

It shouldn't take the sickening of hundreds of citizens to force the government and medical professionals to return to first principles and refocus on the distinction between public and private life. Yet it has.

Abby W. Schachter, a senior fellow at the Independent Women's Forum, is the author of No Child Left Alone: Getting the Government Out of Parenting.