Earth is a sphere becoz any mass that is large enough will eventually be forced into a sphere shape by it's own gravity. Gravity wants to pull everything to the center so everything ends up equally distant from the core, thus the round shape. The earth is kind of oval shaped because of the centrifugal force from it's rotation. It makes it bulge at the equator.
Earth spins because of the way it was formed. Our Solar System formed about 4.6 billion years ago when a huge cloud of gas and dust started to collapse under its own gravity. As the cloud collapsed, it started to spin.