I agree angular momentum is not a complete answer. I think @gavin_kemp 's explanation fills in the gap, however. But I wonder if everyone understood it. So I will reiterate this explanation in my own words. The point is that when you have two bodies, their orbit is going to be two dimensional. But then the orbit of the most massive body will pull others into that same orbital plane. The only difference with the galaxy is the number of bodies involved.
As I explained, the Milky way is not flat at all, because the spiral is only part of it. So you might say that the question really comes down to why don’t we have galaxies with multiple spirals in different directions? And that is where gavin_kemp’s expanation comes into play. They would gravitationally interfere with each other, the same way that unaligned planetary orbits would interfere with each other. Each pulling the other out of shape with the more massive one dominating.
Irregular galaxies are most likely the result of a collision and/or merging of two or more galaxies. And we can see examples of such collisions in all the different stages that we would expect.
In fact, I am beginning to wonder if spiral galaxies are all the ultimate result of galactic collisions. Comparing the stars of in the spiral of the Milky Way to those in the spherical portion (halo and bulge), they are both much younger and more metal rich. The metal richness means they are not first generation stars but stars which formed from the gases of stars that have burnt out and died. Those in the spherical portion (halo and bulge) are old stars and metal poor. This suggest to me the explanation that the spiral is the result of a galactic collision which would both accelerate the life cycle of stars and give birth to more (and larger younger) stars.
Though an alternate explanation is simply that spirals are simply more dynamic and that by itself would cause more star creation as well as larger younger stars. After all, spiral galaxies are the majority 60-77%. Though since spiral galaxies are brighter, it could be we just SEE more of them. It has been more recent evidence that there are far more galaxies than we thought and perhaps this might significantly shift the proportion which are spiral galaxies.