From what I could gather many cases of chronic diarrhea were felt to be related to a nutritional deficiency.
The following article starting page 137 last paragraph talks about it.
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2376709/pdf/tacca00085-0198.pdf
I've pulled out some of the pertinent text.
"During the Civil War physicians noted that deaths from scurvy were usually related to diarrhea, and it is striking that numerous reports from physicians in all regions stated that chronic diarrhea failed to respond to any form of treatment except fresh vegetables. They noted that they expected vegetables to aggravate the diarrhea, and were quite surprised at the beneficial effect. Comparing the incidence of nutritional deficiency syndromes and chronic diarrhea, some relationship is suggested;"
(Scurvy is a disease caused by Vitamin C deficiency.)
___________________________________________
(In reference to Sherman's March to the Sea)
"Men on both sides foraged whenever possible. Although it was officially discouraged most of the time, foraging was the main source of vegetables for most troops, and chronic diarrhea and scurvy were most common when foraging was not possible. The medical problems in prison camps illustrates this phenomenon; as in other situations in which men could not forage, scurvy and chronic diarrhea were ubiquitous, and chronic diarrhea was the main cause of death in the prisons, northern and southern, with scurvy the second most common cause of death (1, 9). Together, they accounted for over 80% of the deaths in Andersonville prison (1, 9). Chronic diarrhea caused more deaths in the entire Union than any other disease-overall, only slightly fewer than gunshot wounds.
The association of scurvy and diarrhea and the response of both to treatment with a diet rich in vegetables, suggests a nutritional component to at least some of the cases of chronic diarrhea. Folic acid is in mostly the same foods as vitamin C; it has similar water solubility and heat liability. The "megaloblastic anemia of scurvy" was shown to be due to concomitant folate deficiency (10). In this century, we know that nutritional deficiencies usually involve more than one micronutrient, especially those associated with vegetables. I think that a nutritional component contributed to the etiology of chronic diarrhea at least in some cases, perhaps in association with enteric infection(s). Such a combination is analogous to tropical sprue as we know it, a process which seems to have a microbial etiologic component, but often responds to treatment with folate. Nutritional deficiency may condition susceptibility to the infectious component."
_________________________________________________
"Civil War physician, Joseph Woodward on chronic diarrhea: "Originating chiefly among troops in camps, the disease evidently stands in some definite relationship to the usual conditions of camp life. Of these, it would appear most intimately connected with the diet, and this relationship is of such a kind that chronic diarrhea becomes more and more common and fatal as the conutional manifestations which result from camp diet approach more and more to the condition of recognizable scurvy, a most important point to be considered in connection with the hygienic treatment of this disease. As a consequence it has more than once happened on a grand scale, during the present war, to see a sudden and palpable diminution in the amount of diarrhea follow the liberal issue of potatoes and onions to an army in which the tendency to scurvy was exhibiting itself ... (11)."