That's a good answer, and one I wouldn't dispute. It seems that gravity causes planet formation and causes them to be approximately spherical, though with slight flattening if they're spinning.
However, it raises an interesting question: how come some galaxies are round whilst others, including our own, are distinctly flattened?