I feel with you (OP). The same happened to me too 2 weeks ago. Of course all the smartasses saying that thats ok and the game is hard etc. all have the same experience. But it's game design. Period. It's same as levelling a toon up to level 50 and then get pushed back to 1 to start grinding up again. Could be done a lot better, for example with pre-paid insurance instead of that surprise-bill.
Just because you do not agree with a game design decision, does not make it '' design, it just makes it a design decision that you do not agree with.
However, FDev have at least given you the tools and the chance to soften the blow of a loss, by keeping enough money for a ship rebuy around and even telling you the amount of money you need for that rebuy. They also leave it up to you and your decisions to just forego that rebuy cost for the possible short term goal of a few thousand credits more in trading profit and your impatience in buying a new ship and you are then punish accordingly. Even then you are still often better off than someone starting completely fresh, as your NPC influence ratings stay the same and you might even have one or two other ships around.
Off the top of my head, there are many games that have modes or design decisions that are as punishing or even more punishing than ED. Almost every rougelike game ever (I'm talking strictly about the turn based rpg dungeon crawls here) will punish you with permadeath on making a mistake and some of those are nowadays so involved and long that it can take hours or tens of hours that you poured into your character before he died. Similarly the hardcore mode on the Diablo games, you make one mistake, one wrong call, you are dead. DayZ and Eve have been mentioned, no insurance cushion there, you die, you start afresh (or almost afresh). Ironman modes on the UFO (X-Com) games will make it so that each decision you make is saved and non-revertable. You make your whole experienced squad die because of bad tactical decisions? Start from the beginning.
So, all things considered, ED is still a very fair game in that it does tell you the exact amount of money you need to keep around to keep your ship and its equipment, even if your current one should blow up. If you decide to ignore that value in your info panel, then, at least for me, everything that does happen to you is your own fault and it was in your hands to avoid the situation you are in.
Remember, if you risk everything, you also might lose everything.
Play it safe, fly safe and you will never have to encounter this problem.