During Major Beall's civil war, chronic diarrhea and dysentery were the most common causes of death among soldiers, due to poor sanitary conditions, bad food and contaminated water. It was the dehydration from continuous diarrhea that actually killed them. Tens, if not hundreds of thousands of soldiers grouped together in a small area without any proper sanitary procedures is understandably a recipe for disaster.
This piece says that 995 out of 1000 (basically all) civil war soldiers contracted chronic diarrhea or dysentery at some point during the war. https://ehistory.osu.edu/exhibitions/cwsurgeon/cwsurgeon/introduction
In modern wars, the problem in less one of sanitary conditions (which are pretty good) and more a nutritional one. Apparently soldiers do not have a varied diet in the field, with few fruits and vegetables, which can cause constipation. Also since Americans like to fight their wars oversees nowadays, traveler's diarrhea is a big problem. This is when people get exposed to foreign bacteria in food and water. If you have ever visited Latin America then you probably know what I am talking about. :) https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4546320/
But of course, I don't think that anyone dies of it anymore the way that they used to.