Evolution of Upside Down Catfish (Synodontis nigriventris)
Well, I haven't managed to find many studies that explores this but I suspect that their coloring was a result of their upside down swimming rather than the other way around. 
They evolved from benthic (bottom-living) creatures that ate off the ground and would have had mouthparts evolved for that. So in order to feed at the surface they would have to turn themselves around. The areas that they lived in may have changed to have poorer benthic food quality making surface feeding more advantageous. They also do this for aquatic surface respiration in hypoxic (low oxygen) waters. 

Check out "Chapman, L. J., Kaufman, L. and Chapman, C. A. (1994). Why swim upside down? A comparative study of two mochokid catfishes. Copeia" for more information.