Through their unique use of sophisticated laryngeal echolocation bats are considered sensory specialists amongst mammals and represent an excellent model in which to explore sensory perception. Although several studies have shown that the evolution of vision is linked to ecological niche adaptation in other mammalian lineages, this has not yet been fully explored in bats. Recent molecular analysis of the opsin genes, which encode the photosensitive pigments underpinning color vision, have implicated high-duty cycle (HDC) echolocation and the adoption of cave roosting habits in the degeneration of color vision in bats. However, insufficient sampling of relevant taxa has hindered definitive testing of these hypotheses. To address this, novel sequence data was generated for the SWS1 and MWS/LWS opsin genes and combined with existing data to comprehensively sample species representing diverse echolocation types and niches (SWS1 n = 115; MWS/LWS n = 45). A combination of phylogenetic analysis, ancestral state reconstruction, and selective pressure analyses were used to reconstruct the evolution of these visual pigments in bats and revealed that although both genes are evolving under purifying selection in bats, MWS/LWS is highly conserved but SWS1 is highly variable. Spectral tuning analyses revealed that MWS/LWS opsin is tuned to a long wavelength, 555–560 nm in the bat ancestor and the majority of extant taxa. The presence of UV vision in bats is supported by our spectral tuning analysis, but phylogenetic analyses demonstrated that the SWS1 opsin gene has undergone pseudogenization in several lineages. We do not find support for a link between the evolution of HDC echolocation and the pseudogenization of the SWS1 gene in bats, instead we show the SWS1 opsin is functional in the HDC echolocator, Pteronotus parnellii. Pseudogenization of the SWS1 is correlated with cave roosting habits in the majority of pteropodid species. Together these results demonstrate that the loss of UV vision in bats is more widespread than was previously considered and further elucidate the role of ecological niche specialization in the evolution of vision in bats.