“I think what’s happened is, there is a more organized and engaged opposition to celebrity claptrap and nonsense, and in general anti-vaccine malarkey,” said Arthur L. Caplan, a bioethicist at the N.Y.U. School of Medicine. “Defenders of vaccination are much more engaged. They’re saying, we’re not going to put up with anti-vaxxers and celebrities maneuvering around the edges of the debate.”

Ms. Biel framed her lobbying against the bill as an effort to support parental rights, according to a statement she posted to Instagram on Thursday.

“I support children getting vaccinations and I also support families having the right to make educated medical decisions for their children alongside their physicians,” she wrote.

In campaigning publicly against the legislation, Ms. Biel follows a number of celebrities who have spoken out on the issues of vaccinations and parental rights. Ms. McCarthy, a former co-host of “The View,” has suggested for years that the measles-mumps-rubella vaccine caused her son’s autism. Mr. De Niro, who has a son on the autism spectrum, promoted a documentary about the alleged dangers of vaccines. Other famous people who have questioned the benefits of vaccines and of limits on medical exemptions include Alicia Silverstone, Jenna Elfman and President Trump.

[Everything you need to know about the measles outbreak.]

“I think when Jenny McCarthy was the main face of the anti-vax movement, medical professionals were a little dismissive,” said Tara C. Smith, professor of epidemiology at Kent State University. “Then she built this empire around these mommy warriors, and became the face of women who felt they were empowered by their personal experience with their children and what they had seen of vaccination.”

Since Mr. Kennedy, 65, started raising questions about the safety of childhood vaccines, challenging a cornerstone of public health, he has become the most recognizable face in the vaccine wars. Scientists have denounced his claims as dangerous, saying they will lead to epidemics that kill children. He has been abandoned even by formerly stalwart supporters, and has lost many friends.

Historically, opposition to vaccines has not broken neatly along political lines. Instead, the position was associated with both the extreme right and the extreme left. In recent years, however, vaccine policy has taken on a partisan bent, with Republicans tending to favor looser immunization mandates, according to Dorit Reiss, a professor at the University of California Hastings School of Law in San Francisco who studies vaccine laws.