Call

Gravitational force is a central force that pulls things radially inward. However objects, in general, have non-zero tangential components which contribute to their Angular Momentum. Angular momentum is a conserved quantity when there is no external torque. Angular momentum depends on the distance separating the gravitationally interacting objects and their angular speed. When a system collapses gravitationally, it starts spinning faster because of Angular Momentum conservation. Further collapse is arrested when it gains enough angular speed that its centripetal force is exactly equal to the gravitational force. The reason why planets don't fall into is exactly the same reason why galaxies in a galaxy cluster don't collapse further.