Interesting. Here in Australia we've had a decades-long campaign to reduce sun exposure as much as possible due to a wave of skin cancers in the '80s and '90s. It's been arguably too successful and now other health issues have become prevalent (eg. vitamin D deficiency) due to too little sun exposure.
Humans evolved while being baked in the sun, it'd be surprising if eliminating sunlight almost completely didn't come with some downsides.
That's probably due to a healthier lifestyle.
Other studies have adjusted for the effects of BMI and exercise levels, and sun exposure is still significantly inversely associated with all cause mortality:
https://onlinelibrary.wiley.com/doi/full/10.1111/joim.12251
Over a period of 20 years, you will double your risk of dying if you avoid sun exposure.
https://www.ncbi.nlm.nih.gov/pubmed/15687362