Why does the Earth Spin on Its Axis?

The earth spins on its axis because the axis is the center of gravity. Also, earth stays in orbit because of the gravity that keeps it spinning on its axis.