That's the story I got from the Sailors that man the USS Constitution. The steel cannon balls would rust together when stacked. To solve this problem they came up with a brass casting that the cannon balls would not rust to. Being on a ship at sea there was always water present and it could get cold enough to freeze and the expanding ice would sometimes push the cannon balls off the brass monkey.
Yep. Old wives' tale, and it's salacious enough to keep telling.
But consider: Cannonballs stacked in a pyramid looks impressive, but imagine such a stack in a heavy sea with the ship pitching and rolling. If the stack destabilizes, you've got 32-pound bowling balls rocketing around randomly.
(in fact, when men didn't like a particular officer, they'd wait until a dark night and bowl a couple of cannonballs at him. It was called, "shot rolling.")
OK...so let's imagine an iron (not steel, in the fighting sail era) or brass rack. Biggest thing there is the expense...neither iron or brass is cheap. And, if you're in combat and an enemy shot hits one of these contrivances, all the shot it holds come rolling out at once. Bad enough on a dark night with a disaffected crewman, but you really don't want a dozen or so rocketing around after the rack gets hit with a cannonball.
Iron, BTW, is fairly expensive and requires a specialist to repair. Brass is even MORE expensive, plus it tarnishes rapidly at sea. You end up having the tars polishing them all the time, and that would not be very popular.
What do you have on a wooden sailing ship that's cheap, available, and doesn't take much skill to maintain?
Hmmmm....what about wood? "Shot Garlands" were wooden racks that carried cannonballs.
Sailors could also braid old rope into big rings to hold shot, too.
Finally, also, the shot were generally painted, and would be chipped and repainted if they started to rust. Not much opportunity to rust together.
Ron "Cheerly messmates all" Wanttaja