The reason there are different skin tones is simply because over time, skin pigments will darken to absorb less light in hotter temperatures. Pigments in the skin are designed to protect the delicate cells underneath them from being damaged when in the heat of the sun, and from UV rays that the sun gives off. The concentration of these pigments is what gives our skin its color. With the more pigment our skin has in it the darker our skin tone becomes. And by the same token if we have less we become lighter skinned.
All humans evolved from the apes in Africa originally, and as such we all had darker skin because of the long durations and high intensities of sunlight there. Over time humans spread all over the world because of our adaptability and superior intelligence as well as overcrowding. Before long of course humans began to move further and further away from the hot climates of Africa and into the colder regions of what is now Europe and Russia. Eventually humans were all over the planet, and in a massive range of temperatures and climates. These can range from temperatures of over 100 degrees most days of the year to well below frozen.
Over the course of the next few million years these primitive cave men evolved into what we are today, and through adapting to their surroundings slowly began to adapt the amount of pigment in their skin accordingly. Those in very hot places built up even more pigment and those in colder climates came to have very little. The peoples that were in the places that were moderately hot would have a Latin complexion today.
The darkest skinned peoples all come from the hottest climates, and have been there for hundreds of thousands of years. The paler skinned peoples have evolved with less and less pigment in their skin, to absorb as much sunlight as they can, because of the fact that in their colder climates, there are less hours of sunlight per annum, and that the sun is not so strong as to damage skin permanently when it is at its hottest. Because of this people who have lighter skin will burn more easily in the sun, and their skin is damaged much faster by being exposed to the sun for long periods.
In todays societies where all the races have moved around, and mixed etc, skin tone is largely more to do with genetics than natural need for a darker or lighter tone to absorb more or less light. For example if you were to go to Australia you would likely find most of the people there to be white. Despite the fact that the natives of Australia are the Aborigines which are some of the darkest skinned people in the world. Similarly if you were to go to for example some parts of the United Kingdom or the northern United States you might well meet black people, despite the fairly cold temperatures there.
Having high levels of pigment in your skin making your skin tone very dark means that you will take very little from the sun in terms of vitamin D as well as ultraviolet rays. This obviously puts you at a disadvantage in a cold climate and can leave you feeling ill and sluggish until you are used to it. Similarly being pale skinned in a hot climate can leave you feeling ill and also puts you at higher risk of skin cancer. The human body being as adaptive as it is however it only takes a few months for the body to be able to absorb the suns light at a suitable level despite whatever skin one you might have and whatever climate you are in.
This being the case skin tone really doesn't mean that much at all in real terms. Particularly because of our ability to adapt and use things such as sun screen in hotter places if our skin burns easily. Evolutionarily speaking developing skin tones was an important survival tactic, but now it is purely an aesthetic look as people today move around all over the world.