Part of the reason I have all my colonies spread around the galaxy is so I can easily restock. Either by taking stuff directly out of stockpiles, or by using a glitch where if you close the trading window and reopen it the inventory resets.
But as to why things work the way they do currently, I think part of the reason is that the game doesn't calculate price per unit of a good, but instead just sets the price for all units you purchase at the initial price (total cost=Amount of goodXcurrent price). For example if I use the aforementioned glitch to reset shop inventory as I'm buying fuel (and I'll be purchasing it in batches of 3k units), the price increases from ~$24 a unit to $30 and eventually $35 as the total planetary stockpile is gradually depleted from my sales. The way price calculation works currently, if the total planetary stockpile was available for sale in the open market (Not from the stockpile, that works differently), then I could purchase all 9k units of fuel for ~$24 a unit, which doesn't really work. If you allowed players access to a planet's entire stock of an item then the buying calculation would need to calculate how much something costs as you buy or sell more units, which is doable but probably annoying to work out the programming logic for.
The current surplus/demand system allows for higher/lower price for an amount of units (example 500) but to do changing costs depending on how much you're buying versus the planet's stocks the game would need to calculate the breakpoints at which buying one additional unit causes the price to increase by at least 1 credit, and then work out your total cost to buy based on these brackets of unit prices.
(As an aside, this kind of limitation allowed for an infinite money exploit in fable. You could purchase a merchant's entire stock of an item at its lowest price, which would cause the price to skyrocket due to low supply, and then sell the item back to them at its highest price, causing a surplus and crashing the price. You could do this back and forth as much as you wanted with no issues (in starsector tariffs prevent this in addition to the limit on how much of a good you can purchase.))