A smaller object like an asteroid doesn't have the same mass as a planet. It is much smaller and more loosely bound together into a spherical shape. The main reason planets have to be spherical is because of gravity. Smaller planets and moons are not always round. Gravity causes the fringes of a planet to tug at one another until the planet is rounded out.
Also, planets are spinning, which creates a spheroid shape. Asteroids aren't big enough to pull themselves into a sphere and most of them are shaped like pyramids. Gravity is at it's most efficient when it creates a sphere, which is because it can't pack that much mass.