 Why were the robots built?
The robots were built to serve Man; to do his work, see to his comforts, make smooth his way. At midday some few of the blue sun's rays filtered through to the jungle floor, but now, late afternoon on the planet, the shadows were long and gloomy. The robot started to shake, then clicked sharply as an overload relay snapped and shorted the blaster cells. "I suppose," he muttered to himself, "that Pete assembled these robots in a batch and then activated them all at once, probably never living to realize that they're tuned to pick up human brain waves, too. The metal killers, tuned to blast any living flesh, would murder them the instant they stepped from the ship! It was crazy, he supposed, to marry a girl and then take off for an unknown planet, with her to follow, to try to create a home in a jungle clearing. The planet's double moon had risen and he could see a robot rolling slowly across the clearing in his general direction, blasting indiscriminately at whatever mind impulses came within its pickup range, birds, insects, anything. Apparently the robot hadn't sensed him yet, but Alan didn't know what the effective range of its pickup devices was. Powerful as a small tank, the killer robot was equipped to crush, slash, and burn its way through undergrowth.
 To protect the people from dangerous animals.
 Nobody knows, they were already on the planet's surface.  To kill any people invading the planet.  To perform labor and help the people build their city.  To protect the people from dangerous animals.