Do humans (and I guess also most creatures) sleep better in darkness?
The simple answer is "yes." The human brain has evolved to sleep better in the dark and be more alert in the light. The reason has to do with the times of day our ancestors traditionally were active or resting. In the case of nocturnal animals, this relationship with light and dark is generally reversed.
For a more thorough summary of why this is the case, here's an excerpt from "Light, Sleep, and Circadian Rhythms: Together Again", by Dijk & Archer, published in PLOS Biology on 23 June 2009:
The 24-hour (h) light–dark (LD) cycle is a fundamental characteristic of Earth's environment and so its powerful influence on the behaviour and physiology of animals and humans that evolved on this planet is not surprising. ...light coordinates the temporal rhythms of physiology and behaviour by sending signals to structures in the brain that contain the central circadian clock. These signals are mediated in part by melanopsin, a photopigment found in the retina. Light affects the brain through these nonvisual pathways, and scientists have recently begun to realize just how pervasive these nonvisual effects are. Mounting evidence supports the view that the effects of light on sleep and brain activity during wakefulness, as well as the duration of sleep and the homeostatic response to sleep loss, depend on both melanopsin and circadian time.
Light and Entrainment of Circadian Rhythms
In humans and other diurnal animals, most behavioural activity occurs during the day, whereas in nocturnal animals, such as mice, most activities are confined to the dark phase. Even in the absence of an LD cycle, the rest–activity rhythm persists with a periodicity of approximately 24 h, instead of redistributing across the 24-h day. More than 35 years ago, it was discovered that circadian rhythms in mammals are driven by “pacemakers” in the brain, which consist of thousands of neurons in structures called the suprachiasmatic nuclei (SCN) in the anterior hypothalamus... The SCN are directly connected to the retina; when this pathway is disrupted, the rest–activity cycle fails to be synchronized to the LD cycle. Normal synchronization, or entrainment, to different LD cycles is accomplished through variation in the response of the circadian pacemaker to light pulses ,. Light exposure late in the biological day, around dusk, will delay the onset of activity in a nocturnal animal, and delay the onset of inactivity in a diurnal animal. Light exposure early in the biological day (dawn) will advance the onset of activity in a diurnal species, and advance the onset of sleep in a nocturnal species. ...
For the full text, visit http://www.plosbiology.org/article/info%3Adoi%2F10.1371%2Fjournal.pbio.1000145.