Evolution does not produce an ideal solution, merely an optimal one! (And optimal solutions may well not always appear to be particularly good! Consider the pros and cons of having sickle cell anaemia in a malarial area)
Skin colour has always been used as an easy indicator of ethnic or racial grouping and yet I suspect that it it is actually one of the least consistent indicators. Skin colour is more likely to be a universal sensitive and rapidly evolving compromise between skin damage and vitamin d production.
Have a look at this site
http://www.bradshawfoundation.com/journey/. The really interesting thing with reference to this discussion is towards the end where the migration to Australia is indicated. Modern day Aborigines are very black indeed and early explorers were deeply puzzled as to how “Black” people had managed to travel from Africa to Australia. The answer is of course that they didn’t. The original settlers 40,000 years ago or so came from the “Northern group” and would likely originally have had skin tones nearer to modern day Asians or Asiatics. Pale skins would not have fared well in the harsh Australian environment (They still don’t! Oz is skin cancer capital of the world) and over time evolution would have favoured those with darker skins until eventually we have the situation we have today.
In a similar vein the pale skins of northern Europeans must have evolved from duskier stock over a remarkably short period of time, rather less than ten thousand years and indeed, the rapidity and the sensitivity of this evolution strongly suggests that the biological disadvantages of a dark skin in higher latitudes are extremely severe, (and almost certainly still are. )
(Before the modern era of mass movement, one could have made a reasonable guess at which latitude a northern European came from to within a hundred miles or so simply by looking at how pale they were. this indicates that the balance is a very fine one.)