It's also pretty easy to make a square peg; just cut the sides down with a knife or saw until it's the right size. Making round pegs requires a lathe, and those are heavy and not very portable.
Fitting a round peg in a round hole isn't easy. Either it's too big, and it won't go in, or it's too small and falls out, or you've spent a lot of time and care making it just right -- and then the humidity changes and it shrinks in different ways than the surrounding wood and falls out anyway.
Square pegs aren't any easier, and there's the additional problem that either the hole or the peg might be a little out of square, so even if it's the right size it might not fit well.
On the other hand, if you take a slightly-tapered square peg and put it up next to a round hole, and give it a good bop with a mallet, the corners of the peg will push into the edges of the hole -- and, because it's only interfering in a few points rather than all the way around, it will squeeze into shape and fit together tightly, and then it will hold fast and not fall out.
So, if you're putting together a barn frame with wooden pegs in holes, there's a pretty clear right way to do it. And that is, indeed, how a lot of barns were framed.
Funny about the idiom, though.