Maybe the dog wasn't really vaccinated. Maybe somebody goofed and marked the wrong chart. Maybe the vaccine just didn't work. There are a hundred maybes-the best bet is to play it safe. The complicated answer lies in the intricate complexity of the canine immune system.
Stress can suppress the immune system.
Vaccines are supposed to stimulate the immune system to create antibodies against disease. This works great when it is a healthy immune system. When the immune system is suppressed, the vaccines may not stimulate antibody production, or there will not be enough response to protect the dog. Unless the dog was reliably vaccinated before it reached the shelter, it may have picked up something while there. Booster for kennel cough at this time, though.