It may be, but the pertussis vaccine has very low efficacy. In this particular case, vaccination does little to stop the disease from spreading, but it does lessen severity and that can be crucial, particularly when infants catch it.
My wife wasn't vaccinated for it while pregnant, but they gave her the shot while she was recovering in the hospital.