Yes they do... when the bacteria passes through them.
Herin lies the inherent limitations of UV units. They don't kill enough beneficial bacteria to hurt anything. The bacteria resides in the substrate, on the rocks, etc. A very negligible amount of bacteria is actually present "free" in the water column. ... and that's good.
At the same time, parasites, such as ich, etc, also are present mostly in the sandbed, which means that a UV unit can only have limited effectiveness against them also. .... and that's bad.