If butter need not be refrigerated one would imagine food stores would not be doing so. During WW2 canned butter was common in our military.
Originally butter was delivered by wagon in jacketed cans. A jacketed can is sort of like a modern thermos. Its a container inside of a container but there is water in the outside container to provide insulation for the butter as cool butter stays firmer and easier to measure.
The weight was estimated by the driver and the customers had to provide their own container to transport the butter to their homes (see Fiddler On The Roof).
Of course as businesses grew and the drivers of the carts became employees rather than the dual role of the owner, favoritism started to show. Someone's cup got a little more butter and someone else's got a little less but both people were charged the same thing. Solutions? there mere many but it seemed that with each system there was someone with a way to cheat it. Pre-measuring and portioning became the norm.
Dairy collectives also formed around this time. With each dairy farmer contributing all of their dairy product into a shared processing plant (more of a series of shacks rather than a plant but you get the drift).
Now came the cost of these sturdy metal containers for butter delivery. They weren't always getting them all back and some of the ones they did get back, well, no one would want to eat something out of again. They started to wrap the pre-measured butter in wax paper.
They cut the butter into block form so they could stack it in a wagon box. the problem is that without the jacketed can and the hard sided measuring can, the butter stacked on the bottom got very soft and the weight of the butter stacked on top caused it to collapse and a huge mess was made of the butter at the bottom.
Jacketing the wagon box (and eventually the entire wagon) solved some of the problem but the butter at the bottom still got misshapened by the weight of the butter above. The cardboard box comes into play here.
The gist of all this is that butter is refrigerated to make it easier to ship store and handle, NOT because it is required to prevent spoilage.