Dragonfly larvae live underwater and adults live in air, two very different environments that require different adaptive traits. Much of the visible light is reflected or refracted by the surface of the water. The quality and quantity of light is different under water than in the air. The visual system of dragonfly larvae differs from that of the adult to better adapt to the underwater visual environment.
Dragonflies have at least 33 genes for opsins*, the light receptor proteins in the visual system. The set of opsins expressed in larvae is different from the opsins expressed in the adult eye. Presumably the different visual receptors of the larvae are better adapted to the underwater visual environment. Dragonfly larvae are predators that rely on vision to capture prey and a well functioning visual system is critical to their survival.
*Extraordinary diversity of visual opsin genes in dragonflies. Ryo Futahashia, Ryouka Kawahara-Miki Michiyo Kinoshita, Kazutoshi Yoshitake, Shunsuke Yajima, Kentaro Arikawa and Takema Fukatsu. 2015. PNAS 112 no. 11: E1247–E1256