UV light is very high energy (hence the burns) and will cause film to be exposed even though we can’t see it.
The UV filter removes UV light from the light entering the camera, which provides more control over the exposure of the film and improves the focus.
The UV filter on the front of my camera's lens.
UV filters are also a good idea to simply keep on your camera because they also protect the camera’s lens from dust and other things that can obscure the image or damage the lens. It is far cheaper to replace a UV filter than it is to replace a lens.