They are at a distinct disadvantage in tropical and subtropical environments. Not only do they suffer the discomfort of readily burning, but they are at a much higher risk for skin cancer.
The same is true of albinos.
It would be harmful if melanin acted as a complete shield. A certain amount of shortwave ultraviolet radiation (UVB) must penetrate the outer skin layer in order for the body to produce vitamin D. Approximately 90% of this vitamin in people normally is synthesized in their skin and the kidneys from a cholesterol-like precursor chemical with the help of ultraviolet radiation. The remaining 10% comes from foods such as fatty fish and egg yolks. Simple vitamin D is converted by our bodies into two sequential forms. The last form, commonly referred to as vitamin D3, is needed for the intestines to absorb calcium and phosphorus from food for bone growth and repair. Calcium is also necessary in adults to maintain normal heart action, blood clotting, and a stable nervous system. New evidence suggests that vitamin D may help prevent a wide range of cancers, including those of the colon and breasts. Vitamin D plays an additional important role in promoting the production of cathelicidin, which helps to defend our bodies against fungal, bacterial, and viral infections, including the common flu.
Too much ultraviolet radiation penetrating the skin may cause the break down of folate in the body, which can cause anemia. Folate is derived from folic acid (one of the B vitamins) in our food.
Pregnant women who are deficient in folate are at a higher risk of having miscarriages and babies with neural tube defects. Because folate is needed for DNA replication in dividing cells, its absence can have an effect on many body processes, including the production of sperm cells. It may be that the ability to produce melanin was selected for in our early human ancestors because it helped preserve the body's supply of folate in addition to reducing the chances of developing skin cancer.
People who live in far northern latitudes, where solar radiation is relatively weak most of the year, have an advantage if their skin has little shielding pigmentation. Nature selects for less melanin when ultraviolet radiation is weak.
The Inuit people of the American Subarctic are an exception. They have moderately heavy skin pigmentation despite the far northern latitude at which they live. While this is a disadvantage for vitamin D production, they apparently made up for it by eating fish and sea mammal blubber that are high in vitamin D. In addition, the Inuit have been in the far north for only about 5,000 years. This may not have been enough time for significantly lower melanin production to have been selected for by nature.