Hello, I apologize for the slow response. This is largely taken from Styer's Biocemistry text, 3rd Ed. Its purpose is is to remove toxic peroxide that is derived mainly as a byprduct of the production of ATP in the mitochondria from the complete oxidation of glucose.
Peroxide is an indirect product of the occasional incomplete reduction of oxygen to water.
The stepwise transfer of elections to oxygen is tightly controlled by a series of protein complexes in the inner mitochondrial membrane. However, at a low rate, an electron is transferred from a metal ion inside one of the catalysts to an oxygen molecule to produce superoxide. Superoxide is very reactive and can spontaneously damage a nearby protein. Catalases are used to scavenge for and destoy this peroxide. It is also deliberately produced in a few cases, most notably by neutrophils and macrophages to destroy bacteria.