LOS ANGELES — California on Tuesday became the largest state in the country to require schoolchildren to receive vaccinations unless there are medical reasons not to do so, as Gov. Jerry Brown signed legislation that ended exemptions for personal or religious reasons.

Mr. Brown, a Democrat, signed the bill after it was passed by significant margins in the State Legislature. The new law was the subject of a long and heated debate in reaction to a strong movement among some parents who refuse to vaccinate their children against infectious diseases like measles.

“The science is clear that vaccines dramatically protect children against a number of infectious and dangerous diseases,” Mr. Brown said in a statement. “While it is true that no medical intervention is without risk, the evidence shows that immunization powerfully benefits and protects the community.”