On the order of ~1 million years ago humans seem to have evolved dark skin. While light skin evolved several times, it looks like dark skin exhibits an "consensus sequence," so that all dark skinned peoples seem to have the same genetic architecture.
This chart (from Signatures of Positive Selection in Genes Associated with Human Skin Pigmentation as Revealed from Analyses of Single Nucleotide Polymorphisms) shows that when it comes to skin color related genes the populations of Bougainville Island (off the eastern coast of Papua New Guinea) and Sub-Saharan Africa are far closer than you would expect based on total genome content alone. Bougainville Islanders are simply a branch of non-Africans, so they should cluster with other such populations. In contrast you can see that the lighter skinned populations exhibit a lot more variance. Plainly there are many more ways to tear down than built up when it comes to this trait. To develop lighter skin you can simply build up loss of function mutations across the genes which result in dark skin in H. sapiens sapiens. But that still begs the question, why did humans develop the consensus sequence which results in dark skin in the first place? Proximately, humans have no fur. This is why researchers who looked at the genetics of pigmentation believe that the point when the last new mutation which produced the ancestral human state, which confers dark skin, is also when you can date the loss of fur to our lineage. But why did the loss of fur necessitate darker skin? Because radiation can cause damage. In the modern world we are well aware that light skinned peoples develop skin cancers and burns when exposed to excessive sunlight without protection. But remember that in the pre-modern world melanoma was the least of your worries; you would probably be dead long before any cancers could end your life. The anthropologist Nina Jablonski has offered I believe the most plausible hypothesis:
UV radiation destroys folic acid, a precursor for folate, the lack of which may result in birth defects.
When it comes to evolution you need to look at the fitness implication any given event, and it can't be more fitness relevant than hitting pregnant females and reducing their fertility. And that is where I thought the story ended. But no. The importance of folate, zinc and antioxidants in the pathogenesis and prevention of subfertility:
Current treatments of subfertile couples are usually empiric, as the true cause of subfertility often remains unknown. Therefore, we outline the role of nutritional and biochemical factors in reproduction and subfertility. A literature search was performed using MEDLINE, Science Direct and bibliographies of published work with both positive and negative results. The studies showed that folate has a role in spermatogenesis. In female reproduction, folate is also important for oocyte quality and maturation, implantation, placentation, fetal growth and organ development. Zinc has also been implicated in testicular development, sperm maturation and testosterone synthesis. In females, zinc plays a role in sexual development, ovulation and the menstrual cycle. Both folate and zinc have antioxidant properties that counteract reactive oxygen species (ROS). Thiols, such as glutathione, balance the levels of ROS produced by spermatozoa and influence DNA compaction and the stability and motility of spermatozoa. Oocyte maturation, ovulation, luteolysis and follicle atresia are also affected by ROS. After fertilization, glutathione is important for sperm nucleus decondensation and pronucleus formation. Folate, zinc, ROS and thiols affect apoptosis, which is important for sperm release, regulation of follicle atresia, degeneration of the corpus luteum and endometrial shedding. Therefore, the concentrations of these nutrients may have substantial effects on reproduction. In conclusion, nutritional and biochemical factors affect biological processes in male and female reproduction. Further research should identify pathways that may lead to improvements in care and treatment of subfertility.
In other words, low folate levels have been implicated in reduction of male fertility. To me this seems to increase the plausibility of Jablonski's model for why dark skinned evolved in our lineage in the first place.