I get what you mean, but I was thinking cargo I have in my ship.
It's already in there when I dock, so why must I get rid of it when I want to change ship?
For instance, if I have 200 tons of, say gold, and I decide I want to try combat, if the station I have my Cobra in doesn't do a good deal on gold, then I either have to sell it for little to no profit or waste time finding somewhere I can make a profit.
And then go back to where the Cobra is stored.
I can load up on cargo, and then exit the game.
I'm not told to empty my cargo hold first before I can do that.
Not totally good answer because real world does not equal FD world, or has to be bear resemblance - but that said, two concepts from real world port authority - docking slips and transit storage.
When a panamax or even larger gigantic ULCV with 14,000+ containers docks at a port, the port makes money primarily on the transit storage and logistics, and secondarily a decent but relatively minor amount on the docking fees. Transit storage logistics for even 1 ship in port, 14k containers is a lot - add the usual half dozen ULCV, equal number of new panamax, etc and the constant stream of inbound trucking and rail flatbeds to move all that tonnage doesn't happen instantly.
Hence the Port will charge Maersk or other major shipping line a pro rata cost based on number of TEU that they have to transit store. So for the example of why can't I just store ship with cargo inside, don't have good answer. The mass to two that ship to where ever space yard they store ships long term probably costs a bit more but we could pay that and seems logical to store things in ship while stored.
But as far as why can't you store ship A with cargo, while that cargo is moved to Ship B that you had in storage - because of transit storage logistics.
If that port had to unload your stored ship cargo, then reload it on your new ship empty cargo space - that is transit logistics they are providing to you that cuts into their ability to provide that same logistics to actual inbound ships with prior agreements for time/payment on limited transit storage.
Every port in the world (well, any port that shipping wants to go to at least), there is always more ships than transit storage logistics. Take a look next time you are near a major port - ever wonder why you see some panamax or ULCV just sitting out in harbor even though you clearly see at least a few docking slips open?
Because they have docking slips but at the moment lack transit logistics.
Like I said, not great answer but seems plausible the star ports are saying no way, unloading you means I lose major money on my inbound transit business.