Milk does not naturally contain very much vitamin D, so that's a silly reason to expect lactase persistence to have evolved. A much simpler explanation is that it massively increases the calories available to pastoralist populations. SLC24A5 is an interesting gene - I don't think Vitamin D is the full story. It's an SNP that is alone responsible for 25-40% of skin tone difference between Europeans and West Africans,…
That is the driving force for lighter skin (unless your diet is mostly fish, such as the Inuit). Skin gets darker again when migration towards sunnier climates happens: while UV light is essential for the synthesis of D3, it also destroys folic acid / vitamin B9 [1], which is essential when the neural tube of a fetus is being formed.
And since this mutation is so very visible, maybe here sexual selection plays a role, just like it is suspected with blond hair?
1: https://www.sciencedaily.com/releases/2014/03/140321095240.h...