They are reasonably effective as long as you run water through them slowly enough and that you don't have any false expectations. Manufacturers and vendor like to make you think that your water will turn into wine by using them.
The bad rep they get is mostly from people that hook them up the way you are talking about, right on a main return line. The water flow is too high, so they are not effective, so people claim it's the UV unit's fault.
Use no more than about 5gph/watt sterilizer power. If you have a 20w unit, don't run more than 100gph through it. If you run it on a canisters' output, most of the really bad stuff, such as viruses and parasites, won't be harmed by the light. The only way UV units are effective is if they acheive a "total kill," in other words, whatever goes in comes out dead, and for that slow flow is critical.