Without hopes, dreams, and desires etc, there would be nothing to drive the robots to take over.
Despite some serious flaws, Data on Star Trek TNG would be a beautiful example of why robots wouldn't try to take over. When the writers weren't foolishly trying to humanize him he would explain that he had no desire to seize control of the ship, didn't feel love or remorse etc.