There are an awful lot of possible causal relationships that could explain that correlation. On the face of it, relationships like "depressed people can't face going outside" or "people who are too immobile to leave the house get depressed" seem far more plausible and powerful than "UV exposure reduces the risk of depression through some yet-unknown mechanism".
Based on what my previous post said, sure, but there are more reasons to believe that sunlight is inversely causal in depression than I stated. I'm hesitant to dig up the research I looked through though, because if I recall correctly, the research really brings up more questions than it answers.
In a more general sense, I agree that more research is needed, but with this and many other facts about our brains and bodies, I'm becoming more cynical about the possibility that the research will be performed in our lifetimes. There's simply too much we don't know and too little funding and too few researchers to find conclusive answers for all of it. People have depression now, and when the risks of the "treatment" are much lower than the risk of the disease, I think it makes sense to self experiment and see if the treatment helps you. Beyond the studies, there seems to be some anecdotal evidence that sunlight does help depression, and I tend to think depression has worse risks than (moderate) sun exposure.
Two notes:
1. From a scientific perspective, one of the problems with anecdotal evidence is that it might be the result of placebo effect, which a well-crafted scientific study would eliminate. But from a medical perspective: who cares? If sunlight improves your depression via the placebo effect, well, your depression has been improved.
2. To be clear about a caveat: I'm not saying go out and self-experiment every home remedy you can find. The bit I said about "when the risks of the 'treatment' are much lower than the risk of the disease" is important. Powerful drugs like ivermectin have dangerous side effects, and trying different supplements can become costly even when those supplements contain what they claim and have lower risks.