When we consider the possibility of life on the planets of other star systems besides ours, one thing is for certain. All stars give off UV radiation, and if we are to maintain the same form as we have on this planet, ie with hairless thin skins, then we will need our melanin as much on them as we need it on this planet.
You may then forget all those scifi films which depict all other foreign planets being populated by white skinned people bossing it everywhere. Whatever planets humans find ourselves on if they are close enough to stars that gives us the kind of climate here and our skin types remain the same (no fur, no scaly skin) we will have to be dark.
Hence this trait is a universal thing. It is not unique to this Earth. You are universally dark wherever you are.
Starshine or Sunshine
What we call sunshine is really starshine. It is the same light and energy given off by all other stars, only in this case our planet is at the right distance for the intensity of the energy reaching it to be be just right to support our planetary life.
This is why the notion of the Sun being hostile to our skins is so nonsensical. Any star would have the same effect. The stars are as they are. They provide their planets with the energy for the life they have. The cells of our hairless skins cells have evolved under the constraints one of these stars set, and it would be the same under any similar star.
There is a beauty in that. They provide us with a freedom, the freedom of a star, the freedom of a sun, the freedom of a planet. The stars are our makers.
Is it so bad to have a form that allows the stars to gaze on their creations without burning them? Is it so bad for a child to have a form that allows its parent to gaze on it without withering it up? It is so bad for the Sun to see Sharon's chocolate form as she floats on the sea, her joy, the way her the whiteness of a teeth sets of her dark skin, the glistening of the water on her skin?
Would you deny the Sun the joy of seeing the beauty of the joy of His own creation, the joy within of His own creation, all day long?