Why does the Earth spin?
The Solar System formed almost five billion years ago from a turbulent cloud of gas and dust. The motions of the atoms and molecules in that cloud were extremely unlikely to average out to be exactly zero. In essence, there would have been a tendency for them to move, or rotate, in a certain direction. As the cloud collapsed under gravity, the conservation of angular momentum ensured that the cloud’s initial rotation was magnified, eventually flattening it out into a disc. The Earth formed within that disc and spins because it inherited its angular momentum from its ‘parent’ cloud.