This is an interesting question… all “why” questions are difficult and this isn’t exception. Anyway, it all comes down to gravity.
One of the effects of mass is that it attracts other mass. For small objects, like computer, your car, and even a building, the force of gravity is tiny. But when you have millions, and even trillions of tonnes of mass (like the earth) the effect of the gravity really builds up. All of the mass pulls on all the other mass, and it tries to create the most efficient shape… a sphere.
I hope this helps, but let me know if I should clarify further.