A ultra-violet (U/V) steriliser will reduce the number of disease organisms in the water. This includes things like protozoans, bacteria, viruses and fungus. However, it will only kill those organisms that pass through the U/V unit and are exposed to the U/V light. It will not prevent infertile eggs getting covered in fungus. The only way to stop fungus on eggs is to use something like Methylene Blue but most people don't bother and just have the eggs in clean water.
The light from a U/V steriliser does not harm fry or eggs in the aquarium and only kills things that pass through the actual U/V steriliser unit.