Over at Abnormal Interests, Duane has written about the ancient beliefs concerning the causes of diseases. The Mesopotamians may have understood that some diseases were contagious, but they also held various supernatural agencies (gods, demons, etc.) ultimately responsible for them. In the mid-1st century BCE, there was a surprisingly accurate idea that "certain minute creatures" were the causative agents of diseases; it was apparently too advanced for its times, though, and never led to anything practical.
Duane doesn't mention it, but there was also miasma, or corrupt air.
I recently read Michael W. Dols' The Black Death in the Middle East (1977). Dols writes that during the plague epidemic of the 14th century "[b]oth the Latin and Arabic authors believed that a corruption of the air, a so-called miasma, had been produced, which was visible in the form of mist or smoke, and was spreading over the land, killing all living things." He later mentions that the debate over infection versus miasma as the cause of plague "lasted until the late nineteenth century in the Middle East".
Until yesterday I was under the impression that by the end of the 19th century for Europeans the sickening influence of bad air had become a belief of the past. Then I changed my mind upon reading, on the way home in the train, the brief account of a mollusk collection expedition by a British fellow named J. Bliss in 1899. He and his companions were collecting in and around the ruins of 2 ancient cities, Magnesia ad Maeandrum and Priene, both located south of the present-day Kuşadası in western Turkey. He describes their activities in the course of a day thus (italics mine):
Stones were therefore turned over industriously, bushes searched, moss carefully picked, and walls scanned, until the declining sun, with the rising miasma, and the knowledge that a band of brigands were in the neighbourhood, warned us that we must not linger longer. Mounting our horses, we quickly traversed the twelve miles separating us from home.We also did a snail survey in that neighborhood in 2004. The picture below was taken from Mount Mycale near sunset; the rising moon is towards the southeast. The slopes below were where Bliss did his collecting. I think I see the miasma over the horizon, which we didn't care about then and, luckily, brigands had long been a thing of the past.
J. Bliss. 1899. Molluscs in Asia Minor. Science-Gossip 5:322.