Good question! Our solar system began as a big cloud of dust and gas, which collapsed in on itself and formed a spinning disk that rotates faster and faster. Eventually the sun formed at the centre and then the rest of the planets etc formed from clumps of dust and gas. These all spin in the same direction as the original disk, because there are no opposing forces to slow them down.
Thank you for asking this, I actually had to research it to find the answer, so I learnt something new too!
Comments