The secretion of hydrochloric acid by the stomach plays an important role in protecting the body against pathogens ingested with food or water. A gastric fluid pH of 1 to 2 is deleterious to many microbial pathogens; however, the neutralization of gastric acid by antacids or the inhibition of acid secretion by various drugs may increase the risk of food- or waterborne illnesses. Peptic ulcer disease is often treated by decreasing or eliminating gastric acid secretion, and such treatment blocks the protective antibacterial action of gastric fluid.
Hope this helped!!:)