The brain controls if an animal can sleep not the presence of eyelids. If an animal has a brain it is able to put the body in a state of paralysis just like you do when you drift off to sleep, and 'power down' for some rest. Even though they lack eyelids they do have a thin membrane that protects the eyes and not only that but cells in the retinas can close them in a sense to help block out any light that may disturb the brain as it handles refreshing the body. This is why some snakes get startled when poked awake, just because they lack eyelids doesn't mean they see all when they are asleep, not at all, it'd be pretty spooky to be jostled from sleep to see a big thing lumbering over you suddenly.
Humans can accidentally fall asleep with their eyelids open, they have bad dry eye however, so lack of eyelids doesn't effect sleep.