Actually, people CAN sleep with their eyes open.
This has been experimentally proved in several tests (including one in which the unfortunate volunteers had their eyelids taped open and their heads connected up to an EEG to confirm that they were sleeping).
So the brain will sleep with or without the eyelids being closed. Why have the eyelids closed (or nearly closed) during sleep then? The most important reason is to prevent the eye from drying out when we're asleep and therefore not blinking. Also the eyelids act as a kind of dust-shield for the eyes, protecting them from debris of all sorts (including tiny insects - aargh).
Some authorities further claim that closing our eyes during sleep excludes potentially distracting visual stimuli from disturbing our sleep. I'm not convinced by this though - it seems to me that evolution could done the equivalent thing with visual stimuli that it does with auditory stimuli (i.e. only wake us up for a limited set of stimuli, like loud noises, or close noises, etc.).
[But since we can't exactly close our ears at bedtime, I suppose you could argue that removing stimuli is optimal, but with the ears we have to just take what we can get. Or perhaps the stimuli are different enough for different optima - e.g. perhaps visual processing requires much more cerebral processing than auditory processing does, and so it has to be shut down at night. Thoughts?]