I'm going to tackle this from a different perspective.
Imagine, if you will, an alien race composed of an organic metal. If we saw them in their true form, we'd say they'd look like humanoid robots; indeed, they blur the line between "Artificial Intelligence" and "Natural Intelligence"...their consciousness is maintained in a form they call a spark, but is this "spark" a highly advanced CPU/hard drive, or is it a brain?
Being composed of metal, members of this species have the ability to transform themselves into pretty much any metallic mechanical object that they encounter. As these alien robots visit earth, they typically assume the form of automobiles. When humans encounter these auto-robots, they are largely unaware of their sentience...let alone the great lengths to which these "robots in disguise" have gone, to protect them from the dangers in the galaxy (or to punish and enslave them).
Interestingly, even these highly-evolved robotic organisms also need sleep. While there is already some speculation as to why these machine people would need to sleep, consider for a moment the device on which you are reading this right now.
How many times has your computer, tablet, or phone, after being on constantly for days on end, just starts acting up? Perhaps it starts going slower than normal, maybe it's just doing some unexpected things. Applications start freezing. It stops detecting I/O devices. Network connections drop randomly.
Oftentimes, a good ol' fashioned reboot will fix your problems. Perhaps an essential driver has crashed; more likely, it has acquired a bunch of memory leaks during the time it's been awake. Restarting gives your computer and operating system a fresh slate when it comes back on, in terms of memory allocation/usage and loaded drivers. Is this not akin to sleeping? It seems like maybe our alien robots even need to do this every once in a while.
Other computer maintenance tasks that could be compared to the benefits and effects of sleeping, which may or may not apply to a race of sentient robotic beings:
The physical storage of data will almost always become fragmented over the lifetime of the system. Occasional defragmentation helps to keep performance up (and to increase the lifetime of the actual moving parts of the computer).
Sometimes, remote applications (typically websites) will create a local copy of its static components on your system, so that everytime you access it, you don't have to keep downloading the same static components. Occasionally, old cached files can cause interference with newer versions of the application, or even with other applications as well. You should clear your application caches every so often to maintain performance.
Obviously, any networked system has a chance of becoming exploited or infected. It is always a good idea to take a few minutes every once in a while and scan and destroy any threats from malicious software.
One interesting question, though, is what these machines dream of when they're asleep.