Why do all of the planets orbit on the same plane instead of being some random scattering. There is a very good reason why that is and it’s pretty much summed up by angular momentum. To truly understand the planar orbits, you need to go back to the formation of the solar system.
Once upon a time, our solar system wasn’t much more than a collection of dust and gas. This dust and gas started to condense due to the pull of gravity. As the cloud got denser, atoms and molecules collided with each other. The energy from this collision was absorbed by other atoms and the entire pre-stellar structure began to rotate. So, now we basically have a big ball of mass rotating around a central axis.
What happens next is best described by pizza dough. Take a ball of pizza dough and throw it into the air while turning your hand (so the ball rotates). This causes the middle of the dough to bulge outwards and the pizza basically flattens out along the same plane. For the most part, the same thing happens with planet formation. The early solar system’s bubble bulges out at the center and the solar system graduates from spinning ball to spinning disk. From here, the planets coalesce and form while moving on this same plane. When the planets are finished forming, there is a little discrepancy in their orbital planes, but not a ton because they are already in a stable orbit. There is simply no need for a planet to switch it’s orbit to be at a 90-degree angle in relation to the plane of the solar system.
However, those 90-degree switches have been known to happen. So, whereas a planet in a polar orbit can happen, they tend to be very rare; most likely being caused by some influence that affected the solar system long after planet formation took place.