Most planetary bodies are spherical in nature due to their origins.
Planets are thought to form in the dusty regions around a star. Eventually a certain amount of matter will have built up and exert a relatively strong gravitational field on surrounding material. It is the gradual accumulation of material under the action of gravity that eventually averages out the accretion process and results in spherical bodies forming. If there is some residual angular momentum left over as the planetary body forms, it may 'spin'. Stars are usually spherical for much the same regions unless there is a strong gravitational force distorting their shape from a nearly astronomical object.