UV kills single cell organisms. Does not matter if they are good or bad.
UV only treats water passing through the unit. Duh.
So free swimming whitespot that just hatch, that goes through the unit gets zapped. But it is not instant lightning strike, but rather a "slow" exposure to the UV light that actually kills the whitespot. So if they past through the unit, they survive. Like running through a fire, you burn, its hot, but you survived (hopefully). Going slowly through the fire and you are dead.
That is why flow rate is important. We need maximum water to pass through the unit. But not too fast. That is why you will see those mega tanks in the US have multiple UV bars. 3 to 5 units.
Also note that the globes last only 6 months. To be really effective you need to keep the glass sleeves clean as well. No point in dirt on the sleeve providing shade for the bacteria.
Ozone also kills free swimming bacteria, but again, only the ones that is in the water passing through the unit. But ozone also have its own issues.
Personally, I know what a UV unit is supposed to achieve. But I do not use one.