Vitamin D (for lack of better official term) indeed has an apparent role in an amazingly broad array of body systems. I suppose calling it a "vitamin" is appropriate in environments with insufficient sunlight which includes northerly latitudes, say above the 45th parallel (where I happen to live).
Presumed deficiency of D (per lab studies) is quite common here and supplementation is usually recommended for optimum health. Besides location, lifestyle factors often reduce sun exposure increasing chances of low D level.
There are tradeoffs involved with most recommendations. The common advice to avoid UV exposure re: melanoma risk has propelled manufacture of sunscreens into a big industry. Sunscreens filter out nearly all UVB, and interfere with forming D. Ironically, low body stores of D may increase cancer risk according to some studies. BTW my dermatologist knows about that, nonetheless advocates minimizing cancer risk, worrying less about vitamin D deficiency or risks of supplementation.
Indigenous Alaskan populations were always vulnerable to D deficiency yet it was uncommon, probably associated with their diet, rich in the oils of sea-going animals, known sources of D. Out of curiosity, a while back based on published info I calculated their intake of vitamin D was roughly 1500-2000IU/day. This seems consistent with opinions of some researchers re: appropriate intake level (don't have the references at hand--I can locate them if there's interest).
The jury's still out on vitamin D in terms of its functions and dietary requirement. It is a fascinating story that with any luck will be at least better resolved in my lifetime.