Sorry to hear about your betta fish--they have such unique personalities, it is always sad when you lose them.
They are definitely a species of fish that can be plagued with mycobacteria. There are two nice articles here, both of which mention mycobacteria and UV filters:
> Dos/Donts for Fighting Mycobacteriosis
> A more in-depth discussion
I am not aware of any high-quality studies looking at how UV filtration on a hobbyist-sized aquarium helps with controlling mycobacteriosis. But anecdotally, I think it helps. I would not worry about it causing problems with bacteria in your biofilter; the bulk of these bacteria live in your filter on the media specially designed for them to colonize, and they are not just drifting around in the water column (which is what the UV sterilization is working on). Also, many commercial aquaculture operations use UV filtration on recirculating systems with no effect on biofiltration.
Hopefully this helps, and good luck with your community tanks. 🐟😎