There were many non-combat casualties. Before WW1, the majority of military deaths were usually due to non-combat causes (mostly disease, but sometimes starvation). Even in WW1, disease was the cause of about 1/3 of military deaths, and disease casualties outnumbered combat casualties. (For US forces in WW1, disease and accidents killed more than combat, about 63,000 vs 54,000.)
In WW2, disease deaths were relatively low compared to combat deaths, but disease casualties generally exceeded combat casualties. For US forces in WW2, there were about 290,000 combat deaths and about 115,000 non-combat deaths including 15,000 disease deaths. About 670,000 soldiers were wounded, for a total of close to 1,000,000 combat casualties. This was probably greatly exceeded by disease casualties, because the total number of serious cases typically greatly exceeds disease deaths. For example, US forces suffered 302 known deaths due to malaria, but almost 500,000 malaria casualties. In some theatres, disease casualties certainly greatly exceeded combat casualties. In the China-Burma-India theatre in 1944, about 2% of US casualties were combat casualties, and 90% were disease casualties. The 1st Marine Division suffered 2,736 combat casualties (KIA and WIA) and over 5,000 malaria casualties. The ratio of combat casualties to malaria casualties was often even more lop-sided towards malaria in many of the battles on New Guinea.
Accidents were another cause of non-combat deaths. In RAF Bomber Command, of the total of about 125,000 aircrew serving during WW2, about 56,000 died during the war, and about 8,000 wounded and 10,000 POW. Of the deaths, about 8,000 were in accidents rather than due to combat. To these can be added another 5,000 deaths in training before joining Bomber Command. Some flying was even more dangerous; during WW2 the US Navy lost about 1,500 enlisted aircrew in air combat and 3,300 in accidents.
Navies could also suffer many accidental deaths; the US Navy lost about 2,200 men in deaths from drowning from accidental sinkings, accidental fires, and accidental explosions on ships (with 790 deaths when Task Force 38 was hit by a typhoon in 1944, almost 400 when the ammunition ship USS Mount Hood exploded in 1944, and 248 when USS Warrington sank in a hurricane off Florida, also in 1944).
Finally, while disease casualties were very high, especially in some theatres, the death rate due to diseases was low, and most sick soldiers returned to duty (with many becoming disease casualties again, and returning to duty again). WW1 and WW2 saw a major change in the proportion of deaths due to disease and other non-combat causes, with combat becoming the main cause of deaths. In earlier major wars, disease deaths could easily be 2 to 10 times greater than combat deaths.