Plenty of companies are valued at more than 5x their assets. Tesla for example is valued at more than 10x their assets. Besides, immorality doesn't really enter into it. The SEC requires public filings to ensure investors can make informed decisions. The rest is up to the investor who presumably would be betting that the company's prospects will increase, at least partly as a result of avoiding bankruptcy an having enough cash on hand to buy some breathing room and recover. Of course, they may be wrong. But immorality only enters into it if there is deliberate deception.
Further, in the case of a company doing what you describe, they would in fact be ensuring their current shareholders, pre-$5b stock sale, don't lose all of their money.
The difference here is that the company was already in the middle of chapter 11. So there is no "avoiding bankruptcy", that part has already happened.
One common scenario for exiting chapter 11 is that you wipe out equity holders so that you can pay off your debts. (That's a major reason why stocks tend to get lower returns than bonds: less risk, less reward.) So, selling common stock like this in order to raise money is effectively robbing - or, more accurately, swindling - the poor to give to the rich, who tend to be the carriers of more senior debt. Which Hertz knew they were doing. Technically, they wrote, "We're selling you lots of $0 for the low low price of $2.50," in the prospectus, but they did that in the full knowledge that Robinhood users don't actually read prospectuses, and that Robinhood users were the only ones who would be buying these shares. So there's your deliberate deception.
The spot where they "buy some breathing room and recover" is the bit where you wipe out your equity holders in order to pay off your lenders as well as you can, restructure whatever remaining debt you have, and carry on. That's more-or-less what chapter 11 (as opposed to, say, chapter 7) is.
I was responding to a comment about a hypothetical, not this particular case. The hypothetical was a company with $4b in debt selling $5b in stock to remain operating. This is not only fine, it is common, especially for private companies where investors are betting on the future success of a company.
Even in bankruptcy, it is not uncommon for investors or banks to give the company bridge loans which the lenders knows full well might be lost if the restructuring doesn't work.
As for this case, it is not robbing shareholders. Chapter 11 is in not an automatic wipe out for shareholders, in fact you'll see other comments here about proposals for alternate plans for Hertz that would not wipe out shareholders. This is, if not common, certainly not unheard of: Restructuring a public corp and keeping it public post chapter 11 means it will still have stock on the market, and in some cases prior shareholders are able to exchanged their old shares for new ones.
It is also not robbing because even retail investors know full well what "bankruptcy" means and no reasonable person would buy this stock without realizing the significant risk for total loss. And in any case, how would Hertz selling stock, knowing the likely risk for a complete loss, be any different than some other institutional investor selling their stock, also knowing the buyer has an excellent chance for a complete loss?
If you mean waiting until the bankruptcy proceedings are over, then waiting isn't always necessary. Lots of investors make high risk investments to companies in bankruptcy with bridge funds to carry them through the process.
The "under no circumstances" clause is not necessarily the case. If it's a large enough company and investors can get their investments to be senior debt, then it can be a reasonable, if still high risk investment. If the bankruptcy occurs, they'll be first in line to get paid out of the remaining assets, even if they don't get everything back. If it doesn't occur, they've got a nice high yield bond. Basically there are ways for investors to make money investing in a company at any point, if done the right way. And probably equally many, or more, ways to lose money.
In the case of Hertz? Yeah, buying their stock when it went meme doesn't look like a very smart move right now. Of course the bankruptcy plan might be amended to slow redemption of old stock into new stock post-bankruptcy, but I'd say that's success by pure luck rather than anything else.
Further, in the case of a company doing what you describe, they would in fact be ensuring their current shareholders, pre-$5b stock sale, don't lose all of their money.