In a mirror the thin layer of metal at the back of the mirror provides the reflection.
If this metal is exposed to air it will 'tarnish' - ie become dull due to formation of oxides on the surface. It can also be scratched quite easily. Both these reduce the quality of reflection. Glass provides a layer of protection for the metal. Glass is transparent and also hard, not easily scratched. It is also stiff and brittle, so it does not easily bend and distort the image.
The layer of glass can actually make the reflection worse, by generating multiple reflections (ghost images) at the air-glass surface - most noticeable at large angles of incidence.