Large size difference between earth and sun and earth's relative linear speed with respect to sun cause part of central force to act as torque on earth to spin it about its axis. See: http://vixra.org/abs/1008.0029
Our solar system began forming within a concentration of interstellar dust and hydrogen gas called a molecular cloud. The cloud contracted under its own gravity and our proto-Sun formed in the hot dense center. The remainder of the cloud formed a swirling disk called of the solar nebula.
The cloud had a net angular momentum and was spinning, but it was initially gas, dust, and plasma. Planets spin quickly because the gas cloud they condensed out of had a very small amount of angular momentum. Similarly, an ice skater who started out spinning relatively slowly with their arms extended, will spin much faster when they pull their arms in towards their body. Thus as gravity pulls in and contracts the gas cloud, whatever rate of rotation it had would be greatly increased as the Sun and the planets form. Planets spin and in fact planets exist because of the conservation of angular momentum.
But where did the initial angular momentum of the gas cloud that became the protoplanetary disk come from? Well, it did not need to have a large scale coherent rotation as a whole, all it needed was to have different parts of the gas cloud moving in different (even random) directions. That would be enough to create some small amount of non-zero angular momentum which would eventually cause rapid rotation as gravity condenses the gas cloud to a protoplanetary disk (similar to when an ice skaters arm pulls arms in). The random initial velocities of different parts of the cloud were probably caused by nearby supernovae explosions, that led to the cloud to collapse in the first place.
Moreover, during planetary accretion, not all of that matter will hit (collide) the forming planet on a vector aligned exactly with the center of mass of the planet. Some will hit a glancing blow and put a rotation on the planet due to torque, leading to rotation of the planet.
All planets rotate about their own axis due to this reason, including Earth.