Actually, gravity is only a partial answer, though an important one.
A sphere is the perfect distribution of force per area, and liquids, being viscous (runny) substances, tend to distribute their weight about evenly. In a vaccum like space, where the influence of other objects on Earth is relatively small by comparrison to the Earth's own mass, this results in an almost-perfect sphere.
In clouds, where falling rain drops have to contend with gravity and wind resistance, this forms anything from a 'tear drop', to a long thin streak that looks almost like a falling pin, depending on the conditions.