The formation of spherical blobs of water in space is because of surface tension. This is only exhibited because it is a liquid. However at the astronomical scale, the gravity of a sufficiently large object will eventually turn it spherical. The object has to be at least the size of a planet because only then will the gravitational forces be large enough to change the shape.
The shape is usually close to a spheroid. This has got to do with the fact that a sphere has the smallest surface area to volume ratio of all 3-dimensional shapes. The earth is flattened at the ends due to its angular velocity.