Dr. Paul Offit was pretty sure that religion was harmful to children.

But while writing his newest book on medicine, the co-inventor of a rotavirus vaccine was surprised by Jesus.

Offit says he always had moderate respect for religion but started to doubt when, as a young attending physician, he saw five children die within 10 days during an outbreak of measles in Philadelphia in 1991. At the center of the epidemic were children who were unvaccinated in accordance with their parents’ radical brand of Christian belief.

A professor of pediatrics and vaccinology at the University of Pennsylvania, Offit has been branded as “Dr. Proffit” by anti-vaccination activists. In previous books, he has defended vaccinations, challenged the now widely discredited autism-vaccine link and sharply criticized the alternative medicine industry. When he published “Autism’s False Prophets” in 2008, he didn’t go on book tour because had received death threats.

Having seen children die because of their parents’ religiously-motivated neglect — including the use of religious exemptions to vaccination, Offit began to read and to appreciate new atheist writings, including books by Sam Harris and Christopher Hitchens. As he began writing his new book, “Bad Faith: How Religious Belief Undermines Modern Medicine,” he assumed that he would arrive at similar conclusions: that religion was too often the culprit in preventable deaths, and that it was best left behind.

“Bad Faith” is full of stories of needless deaths: the children of Jehovah’s Witnesses dying for lack of a blood transfusion, the children of Christian Science believers dying for lack of antibiotic treatment and the infants of ultra-Orthodox Jews dying or suffering brain damage after being infected with herpes from unsanitary ritual circumcision.

Most states allow religious exemptions to vaccines and permit parents to claim a religious defense if their child dies from a treatable disease.

“I took it at face value when people said, ‘Jesus was our doctor,'” Offit said of vaccination and treatment. “The choice to put your child in harm’s way is not a religious act.”

When Offit began to read the Hebrew Bible/the Old Testament and the New Testament and look into the history of Christians’ work in the areas of child welfare and health care, he said he found himself largely embracing religious teachings.

Offit told me he was surprised by his reaction to faith. Asked what particularly changed his mind about religion, he said, “I read the New Testament!”

“Reading slowly and carefully, in context, I came to feel that independent of Jesus’ divinity, independent of questions about the Gospels’ accuracy, you have to be impressed by Jesus,” he said.

Offit said that Jesus’ advocacy on behalf of children, who were treated as property in the ancient Greco-Roman context, moved him “to the point of tears.” He referred to Christianity as “the single greatest breakthrough against child abuse” in history.

Offit highlights and praises the Christian tradition of caring for the sick and vulnerable. He notes, for example, that the first Christian emperor of Rome, Constantine, outlawed infanticide in 315 and provided a nascent form of welfare in 321 so families in poverty would not have to sell their children.

Historical expressions of care for the sick, Offit said, are aligned with “the religion of Jesus.” He has little patience for Christian practices (“religion about Jesus”) that place children in harm’s way by pitting modern medicine against faith.

Those who insist that medical treatment is unnecessary “because Jesus is my doctor” are promoting ideas antithetical to Jesus’s values, he said. Offit has not converted to Christianity, but he has newfound respect for the religion that motivated people to abolish slavery and establish the Red Cross.

“Stating a religious belief is seen as a kind of immunity from responsibility,” Offit said.

Offit believes that religious exemptions to vaccinations — and the freedom for parents to refuse medical treatment on behalf of their children — should not be allowed. “It’s not much different from child sacrifice,” he said. To others, removing the religious shield currently protecting parents in most states is an example of government overreach and a violation of the free exercise of religion.

Using the state to defend parents who refuse modern medicine, Offit suggests, is not the kind of religion Jesus established.

“That’s making religious freedom an idol,” Offit said. “How on earth in the name of Jesus can people watch children die?”

Rachel Marie Stone is a writer living near Philadelphia. She is author of “Eat With Joy: Redeeming God’s Gift of Food” and “The Unexpected Way,” a book about Jesus for children.