Yes most galaxies are spiral,elliptical and bared. The reason for this is the same reason planets orbit stars; gravity. Before the universe had "structured" galaxies masses of gas and dust could just clump together and probably created a massive star with a short lifetime, after the stars life it is likely that it would turn into a black hole. (A super massive black hole to be precise) which then pulls in a load of other gas and dust along with a few other elements it spat out when it turned supernova. These clumps slowly formed bigger clumps until the same thing happened on a smaller scale and stars with longer life times were produced. Of course these are stil being pulled towards the super massive black hole and they begin to travel faster and faster. Some of these stars would be sucked straight to the middle of the black hole while others would just escape it and begin to orbit it. This is how they get their shape. As for the arms instead of the stars all being even distances apart some would be heavier and pull themselves towards each other to form clumps among them.