The discovery of the causes of scurvy is an interesting one. The issue was not as simple as smart scientists Vs dumb military brass. Actually science was pretty terrible at this due to what appears to be an in built bias towards wanting diseases to be caused by infectious pathogens. At the time they knew about bacteria and wanted to explain everything this way. Scurvy looks superficially like it might be caused by bacteria: there are localized outbreaks that start with one person and it rapidly "spreads" to others. The true cause was repeatedly discovered and then forgotten or dismissed by physicians invested in the bacterial hypothesis. It took several independent rediscoveries before the navy saw through the confusion.
Where does this bias come from, probably, it feels much better to be battling an external enemy than to "blame the victim" as we'd say these days.
Beriberi was studied by the Japanese at a time when the theory of infections germs was developed by the Germans, and the Tokio University bought fully into this theory. There was another guy called Kanehiro Takaki who proved that it was actually caused by bad nutrition, but the Japanese army chose to ignore his findings until the Russo-Japanese war which cost so many lives due to beriberi that they were forced to adapt a better diet.
Where does this bias come from, probably, it feels much better to be battling an external enemy than to "blame the victim" as we'd say these days.