Before the solar system formed, there was a large cloud of space dust. This dust was flying around in random directions, but if you took the average of it you would find that there is some direction in which the dust is moving more than the other directions in average. This average motion as it all swirls around itself means that it has some angular momentum, which is given by the equation L = I v / r. As the dust moves around, it collides with the rest of the dust, and so motion that isn’t in the average direction cancels out and the cloud flattens into a disk. The angular momentum must be conserved though, and so as some of the dust gets pulled further into the centre the speed at which it spins must increase. This is where the velocity of Earth’s rotation comes from.
It is always the same speed because there is nothing to speed it up, although technically it is actually slowing down slightly due to the tidal forces of the moon, the same thing that causes the tides in our oceans.
Earth spins because it was formed by small pieces of material that were also spinning. Those pieces were all spinning because the chaotic nature of the early solar system made it impossible not to spin. When it first formed, Earth spun significantly faster than it does today, completing a full revolution in 18-20 hours. Over billions of years gravitational interaction with the Moon has gradually slowed Earth’s rotation to the 24 hours we see today.
It goes back to the Big Bang. The Big Bang sent stuff flying around in all directions, because of gravity stuff started to get attracted to each other and because they were moving so fast, there was nothing to stop them so instead of colliding and stopping they started colliding and spinning, and since there is nothing stoping they kept rotating.
Latest Answers