The Earth began spinning when it was formed and doesn't stop spinning because there are no forces to stop it. The planet began spinning faster as it was being formed. Initially, the Earth's own gravity collapsed, which made it start spinning and is why it continues to spin.
The Earth rotates at a speed of around 1,070 miles per hour. If the Earth were to suddenly stop spinning, which scientists don't believe will happen in the next few billion years, the atmosphere would continue spinning and everything on the land, not attached to the bedrock, would be wiped off the planet and blown into the atmosphere.
Many scientists believe that the Earth will stop spinning but that it will do so slowly. If this occurs, every location would on the planet would be plunged into perpetual daytime or nighttime.