Ford , at least , still uses square nuts on body panels, by trapping one side of the nut with a tab, it can be kept from spinning when you put the bolt in the other side...
aside from fitting is a smaller space, hex heads and nuts are slightly stronger than square , the tips of the corners of a square nut are so far from the center that they contribute very little to the holding force on the bolt...(Because the steel is slightly elastic, they just bend upwards)
Having more tips, means you can make the metal between them thicker (further from the center of the bolt) and get a little more holding force from it, without making the overall diameter larger...
(dunno if that explains much, explaining geometry is kinda tricky ;P)
I somewhat suspect that the real factor that decided the final fate of square nuts was the detatchable socket tho, very hard to make a strong socket for square nuts, not so hard to make one for hex nuts, and sockets made it much much easier to put things together and take thenm apart..