Before 1900, armies usually lost more men from infectious disease than combat, particularly in extended campaigns. At least that seems to have been the case in modern Western history.
There are indications that infectious disease was qualitatively different – less important – in the Roman legions. For one thing, camps were placed near good supplies of fresh water. The legions had good camp sanitation, at least by the time of the Principate. They used latrines flushed with running water in permanent camps and deep slit trenches with wooden covers and removable buckets in the field. Using those latrines would have protected soldiers from diseases like typhoid and dysentery, major killers in recent armies. Romans armies were mobile, often shifting their camps. They seldom quartered their soldiers in urban areas – they feared that city luxuries would corrupt their men, but this habit helped them avoid infectious agents, regardless of their reasons.
They managed to avoid a lot of serious illnesses because the causative organisms simply weren’t there yet. Smallpox, and maybe measles, didn’t show up until the middle Empire. Falciparum malaria was around, but hadn’t reached Rome itself, during the Republic. It definitely had by the time of the Empire. Bubonic plague doesn’t seem to have caused trouble before Justinian. Syphilis for sure, and typhus probably, originated in the Americas, while cholera didn’t arrive until after 1800.