Quite a few games with dynamic prices have this kind of exploit where the game doesn't take into account that the player is selling a large quantity of items. IIRC Fable: TLC had it, as well as other games. A vendor has a lot of a particular item, so he's offering them cheap. You buy the whole stack, and every item in it costs the same (whereas if you bought one at a time, the price would ramp up). The vendor now has none, so he's willing to buy for a lot. You sell the whole stack back to him for a profit. Repeat until you have enough cash that you can buy everything there is to buy in the game. It's not quite as bad in Starsector but it's still very exploitable.
It's a combination of factors. Food shortages occur regularly on Sindria, which is relatively close to the Luddites, who produce tons of food. Both the producing planet and the receiving planet have a jump point right next to them, so the run is very fast and efficient. You can store an infinite amount of food for an infinite period of time for zero cost (aside from a tiny one-time fee). The receiving planet will buy an unlimited amount of goods for shortage prices during a shortage. The punishment for flooding a market is tiny.
I have 5 superfreighters right now hauling food from the Luddites to a warehouse on Sindria. That's 10K at once, enough to end a food shortage in one trip. But I'm putting it in a warehouse because Sindria will buy as much as I have when the shortage hits. Right now I have 50K there and more is on the way. I'll make millions of credits and tons of XP when the shortage inevitably hits, and what will it cost me? 5 reputation with Sindria? Yeah, okay, so I'll go from 98 to 93, whoop whoop.
IMO at the very least the market should only buy as much as is needed to relieve the shortage for shortage prices, any goods in excess should sell for post-shortage prices. Additional measures could include limiting storage space and/or enforcing a storage fee, making food perishable, and making the severity of the penalty for flooding a market dependent on how much you flood it. Ideally it would be a combination of all of these. I quite like Starsector's 'soft cap' approach to things like cargo capacity, IMO the same should be the case here. It would be nice to see the change from shortage to post-shortage prices be gradual rather than sharp and immediate, etc.
Also, given that the Sindrian Dictat is, y'know, a dictatorship, I was quite surprised that the Sindrian authorities didn't just go "damn, we have people starving to death in the streets and there's a giant warehouse full of food right here, so fuk it, we're taking it". That could be another method of countering this kind of exploit. And also a neat way of giving the factions different personalities, come to think of it. Maybe some factions are willing to confiscate your goods in an emergency and others aren't? Eh, I'm rambling at this point.