You want to see the fluorescence caused by ultraviolet light, not the UV light itself.
The UV light from torch illuminates the corals, some species then emit light in *other* wavelengths and this is what you want to see. You block with filter in the mask (or lens) the stray/reflected UV up to blue wavelengths and thus enhance your perception of the light from luminosity of corals. We don't see UV but most lights (or at least the cheap ones) are not narrow 395nm and have some wider spectrum purple tint that you can filter out and get better contrast. Maybe also protection if you shine the light directly in your eyes- at night if only source of light is the UV torch also your pupils will be wide open.
I don't use any filters with my cheap UV light. For me it's part of the experience and as a side effect I hum Jimmy Hendrix's Purple Haze and my air consumption is increased
Many years ago I had an HID light that also emitted a little bit in the UV range. In that case the regular visible light was too strong and the UV/fluorescence effect was outshined. I improvised a UV pass filter on the torch itself that blocked most of the visible light except the UV wavelength, so now all I could see was almost nothing, just a barely observable faint purple. Until it hit corals and brought an asotnishing fluorescence. Now my cheap UV light is mostly purple but works so no complains.
In general photography, for example, uv filters are applied to remove haze etc.