When a field of things within mutual gravitational attraction are spinning, they tend to flatten out. That’s because the uniform central pull from the gravity is influenced by the outward, perpendicular centrifugal force from the rotation.
Even the earth, which a very low angular momentum to mass ratio, bulges at the center because of the same effect, only much less marked. As a result, the earth has the shape of an oblate spheroid.
In a solar system or galaxy the mass to angular momentum ratio is very high, causing the formation of a nearly flat disk.