The most important function of hydrochloric acid in the stomach is:
Functions of HCl are: 

activation of pepsinogen to pepsin by providing acidic medium,
bacteriolytic action and
acidification of chyme which cause release of secretin and cholecystokinin hormones.
Destruction of bacteria
Neutralization of chyme
Activation of pepsinogen
Stimulation of pancreatic secretion