What makes the earth rotate?
The spin of the Earth is the net angular momentum of the bits and pieces from which it accumulated.
Due to the tides caused by the Moon, the energy dissipated by the tides is transferred to the Moon as an increase in its net energy - and represented by the Moon moving a slight bit further away.
And of course, a decrease in Earth's energy, as a slightly longer spin period. This is the cause of the "leap seconds" occasionally added to our clocks.
[Some of the energy of the tides is of course dissipated as heat on Earth.]