There are more bacteria than human cells in the typical body. Most are good and help digest food.
But sometimes the flora of bacteria in the intestines die or are purged. Diseases such as cholera or amoebic dysentery would clear the gut of useful bacteria. The appendix's job is to reboot the digestive system in that case.
Improved hygiene has made its purpose less vital relative to the risks that come with an infected one.