ANTANANARIVO, Madagascar—In September, David Ranaivo woke up with a high fever and felt very weak. He went to a nearby hospital, but was so depleted he could barely answer the doctor’s questions.

Around 24 hours later, the doctor returned with a diagnosis: the plague.

“I was totally devastated,” said the 31-year-old businessman. “I was thinking,...