To amplify Simon Bridge's answer, moons are dragged toward the plain in which the planet they orbit orbits its star. So moons outside the elliptic are either recently captured or had a recent near collision or collision with another object. The rings of Saturn are a sufficient sample to "prove" this.
As for planets of non-multiple stars, we have no idea. In the solar system we can probably blame the innermost planets being in roughly the same plane on Jupiter. It is not a star, so the sun is not part of a double star, but it is probably close enough to act on the orbits of the inner planets. More likely it is the tidal effect from Jupiter, plus the fact that the sun is an oblate spheroid (fatter at the equator) that gets the inner planets to behave. Take the asteroid belt and compare to Saturn's rings. The asteroids inclinations are all over the place.
Going out in the solar system, Uranus famously rolls on its side, and Pluto and the other Kupier belt objects have the same sort of scatter (or more) compared to the asteroid belt.
What about all those exoplanets that have been discovered? The two main techniques used to find exoplanets do not, in general, tell us about the inclination to the parent star, or to other exoplanets in the system. That data gets winkled out later if at all. But already some exoplanets have been discovered that orbit the parent star in the direction opposite to the star's rotation.