Doctors warned people to stay away from the medical tent where patients were being treated in order to avoid contagion because being close or in contact with infected patients can spread the infection and more will suffer from diseases. At the same time, people should stay away from the patients because, their immunity is weak, and they could also acquire more infection from those people outside.
There are several things that Shirley Jackson accomplishes by using stock Characters in "The Lottery", but the best would be that the reader focuses more on the story.