Well, keep in mind we’re talking about two separate things. There’s the physical structure where you keep goods. And then there’s the legal right to require goods to be stored in a public warehouse where they would be guarded by public officials and inspected by public officials, paid for by excise taxes on those goods.
Municipal warehouses were important pieces of civic infrastructure, because they provided an amenity that encouraged merchants to trade in that city and to bring larger quantities of goods, because those merchants knew there would be somewhere to store their goods, that they could bring goods in bulk (as opposed to just arriving with samples and then taking orders that would be shipped later), and that they could be assured of a certain standard of product quality.
And yes, you needed a charter to make all of this legal; that’s what it means to live in a pre-capitalist society – there is no assumption of a “free market” in which the government doesn’t intrude; rather, governments create markets by extending legal privileges that lower transaction costs. For more on this, I highly recommend Karl Polayni’s Great Transformation.