Planets orbit a star on the same plane because that plane is where dust and gasses collected. It's due to gravity. The dust and gas perhaps was thicker on that plane after the Sun formed, so the rest of the dust all over the place was dragged into line. So now you have a whole pile of dust and gas orbiting a star on the same plane. Therefore all the planets that form out of that debris, form essentially in the same place.
It's the same for galaxies. Although a globular cluster would be more of a sphere shape, but you're right, most galaxies are discs, and it all has to do with gravity.
This image shows what i'm talking about
:
The debris around a star will eventually pick a plane to gather on and orbit, and then the dust will start to clump together to form planets over hundreds of millions of years, or billions even.