And also
People have been quarantined during epidemics since forever. If they didn't think it could be spread that would not have happened. In Britain under Henry VIII the king would not leave his home because of the "sweating sickness." To this day we do not know what that was. They did not. But they knew enough to see cause and effect. Sick person comes near, others get sick. We are only pretty sure it's HIV that causes AIDS, but it's the most credible candidate and we proceed on that because so far, targeting it seems to work. But even before we knew that we knew ways to protect yourself against it, or at least minimize its danger.
If people didn't think sickness could be contagious, why did they send away lepers? Why did lepers have to warn people when they passed through?
They understood that sickness can spread from person to person. I'm sorry, but I just cannot imagine the human race would have survived if people didn't understand the concepts of infection or contagion on a basic level. To say they attributed everything to evil spirits is simply not true, and I should also point out that a foot soldier would know that's crap; there's nothing as practically-minded as the soldier on the ground and illusions get killed quick in battle. They were, as it says above, not stupid, they simply didn't have our accumulated knowledge.