A UV will only kill what passes through it so to say that it will kill "all" bacteria is incorrect since bacteria reside on all surfaces of the aquarium as well as the water column. UVs work well but you have to size it right and run the proper flow to acheive the right zap dosage or you aren't going to kill anything. It can clear the water depending on what's clouding it. The real upside is at the higher dosages where it will kill parasites which is great for a reef tank since the majority of people don't quarantine their livestock. The loss of bacteria in the water column or fried juvenile pod population isn't going to have a negative effect on the overall health of the tank.
To say that a UV should be avoided because it kills indiscriminately would mean that we should also avoid protein skimmers since they pull out the same stuff the UV is killing. I don't know of any protein skimmer that leaves certain baceria or microfauna in the tank and only removes the bad stuff...