The planets are believed by many authorities to have coalesced from a cloud of gas early in the evolution of our solar system, beginning roughly 5 billion years ago.
Since the gas cloud was disk shaped, when the planets came to be within this cloud, they all formed basically along the same plane.
There is a notable exception, the tiny planet Pluto, which has an orbit that is tipped as much as 17 degrees to the plane of the solar system. It has been hypothesized that Pluto might be everything from an escaped moon of Neptune to a special type of minor planet or asteroid.
Because of its anomalous orbit and other factors, there is great debate among astronomers as to Pluto’s exact status as a member of the solar system.