The location of galaxies is thought to have been triggered by quantum fluctuations in the earliest moments of the universe that caused matter to be denser in some locations. But why would you expect galaxies to NOT be randomly oriented?
Minute Physics have a nice video on this: https://youtube.com/watch?v=tmNXKqeUtJM
And just to clarify to GP, the original dust was not in the same plane and the video explains why it ends up in the same plane.
So too with galaxies---which, from a cosmological perspective, are essentially infinitesimal dust.
Well that depends on what your intuition about randomness is, doesn't it?
Flipping a coin is not random, but you can't tell me the answer before it happens.
Similarly, galaxy orientation is not random, but predicting the world we perceive is perhaps not so easy.