Why does earth spin around sun and also spin around its own axis?

why does earth spin around sun and also spin around its own axis?
7 answers 7