Why is too much sun bad for our skin? I thought the vitamin D that the sun gives off is great for humans.
The vitamin D produced by exposure to sunlight is good for us. But it only requires a few minutes a day of modest (that is, normally clothed) exposure to sunlight to produce enough vitamin D for most health purposes. (Depending upon how bright the sunlight is, ten to twenty minutes is quite adequate.) The problem is that at the same time sunlight produces vitamin D in our skin, it can have other effects that are undesirable. So excessive exposure to sunlight can be damaging in a number of ways.
For instance, you may have heard that some medications may not work properly if the user is exposed to excessive amounts of sunlight. This is due to the fact that skin is to a certain extent transparent, and some types of sunlight can penetrate the skin and reach the blood vessels beneath the surface. If the blood in those vessels contains medications that can be affected by sunlight, they can be rendered useless, or even toxic. (This is one reason that many medications come in bottles that say "Keep in a cool, dark place".)
Even when not taking medications, certain types of sunlight (which happen to include those that produce vitamin D) can damage cells in the skin itself. The body tries to protect itself from this damage by "tanning". So if you are exposed to a minimal amount of sunlight, and do not tan (or sunburn) as a result, you can probably presume that you are not receiving enough damaging radiation to worry about. But if you do tan or sunburn, that is direct evidence of significant damage to the skin (and those subsurface layers reached by radiation not blocked by the skin), which will inevitably lead to premature aging of the skin, and in many cases to skin cancers of various types -- some relatively benign and easy to deal with, and others aggressive and often fatal.
So it is not so much that sunlight is particularly dangerous, but that too much sunlight can be. In fact a recent medical article stated that parents should allow their children to play outside in the sunlight for a few minutes each day before
slathering them with high SPF sunblock, so they can receive the beneficial effects of sunlight without having to take vitamin supplements. However, after those few minutes, it is recommended that further exposure to sunlight without adequate protection be put off until the next day, so that the body has time to recover from any harmful effects that might have occurred during those few minutes of "unprotected" exposure.
(As a side-note: I don't know if it's available on the Internet, but many years ago Science News had an article about the various effects of exposure to sunlight. The cover had an amazing picture showing a 90-something year old Buddhist monk with baby-smooth skin on his smiling face, thanks to his having spent practically his whole life indoors. Next to that was a picture of an unbelievably wrinkled crone who looked more like a thousand year old mummy than the 50-something-year-old she was, as a result of a lifetime spent out in the Sun.)