This paper is from 2013. It is out-of-date. More recent large scale studies of Vitamin D supplementation show no benefit, except in cases of substantial deficiency.
https://www.nature.com/articles/s41574-021-00593-z
Sunlight, however, does show benefits. This suggests that Vitamin D is just a side effect of sunlight exposure, and does not by itself do any good.