That stems from nebular theory. The nebula the solar system forms from flattens out to a disk; the rotational momentum contained in that disk is maintained as the planet/moon system forms, in roughly that same plane.
It's also the reason why most moons orbit in the same direction a planet spins, and in the same direction the planet orbits. (A few notable exceptions here & there, probably 'captured' moons - like Triton around Neptune).
The original solar nebula had, by chance, a slight angular momentum. As it collapsed under gravity, gas that did not favor this direction of spin tended to collide and cancel their momentums, falling toward the center and forming the sun. The gas which did was less prone to collision, until that was all that was left, forming the protoplanetary disk. This particular angular momentum was so small compared to the rest that it makes up less than 1% of all the matter in the solar system.
This is not quite correct. The plane of the Ecliptic & equatorial planes of Planets differ mostly. Again the plane of satellite orbits have non-zero orbit inclinations with the planets' equatorial planes, like the Moon has w.r.t. Earth.