Not everyone loses the ability to synthesize and activate vitamin D, in other words it is not always age-related.
The kidneys are a prime site of activation ergo if significant kidney dysfunction is going on, vitamin D activation will also be compromised. The liver is another site -- the P450 enzyme system and other enzymes are involved. GLUTEN and high fiber diets KNOCK THIS OUT. Ergo happy wholediseasegrains are at the center of vitamin D deficiency combined with blatant sun-phobia with the overuse of sunscreen.
Drugs -- many drugs (birth control, statins, any sulfur-derived pharmaceutical which is A LOT OF PHARMACEUTICALS, diuretics/'water pills', etc) cause photo-hypersensitivity.
Lack of vitamin B3 -- induced by phytic acid by oats, grains, whole brown rice, etc (also known as the vampire condition -- pellagra) causes photosensitivity which again will affect and increase sun avoidance, further worsening vitamin D deficiency.