Modern day robots may not be as entertaining as R2D2 or the robot from Lost in Space, but robots are very important to space exploration and are being used in a variety of different ways for several important reasons.
Robots make great explorers on planets, moons, and other landing areas. Aside from the earth, just about every surface in the solar system is unsafe for humans to explore. The air on most other planets is insufficient for humans to breathe, making it necessary to wear a space suit and oxygen equipment. The temperatures on these surfaces are much too hot or much too cold for any humans to withstand. Plus there would be complications with radiation, weather, and a lack of gravity. Robots have much less limitation in these areas and can survive much longer under these conditions.
Robots are designed for collecting scientific data. Robots are also able to perform many tasks at one time and can process information much quicker and more efficiently. Important scientific projects from detecting minerals, analyzing ground samples, and finding water are all performed much quicker and accurately by robots.
The use of robots has made the cost of space exploration much less expensive than it would cost for humans to do the work. In order to successfully send humans into space we would need to build a vehicle that can not only carry humans, but also enough food and water to keep them alive for the duration of the trip. Moreover, robots have no problems working for hours on end. Robots never complain, they don't require food or water, and they never need a bathroom break.
Over the past 30 years or so there have been many different types of robots used successfully in the exploration of space. Perhaps the most famous and successful robots are Spirit and Opportunity who have both been exploring the surface of Mars. They have both been very successful with experiments on soil and rocks and have even found evidence of water in Mars' history.