Yeah that’s an absolutely grotesque situation. I’m in Canada though so it’s a bit different.
In practice people also don’t get fired here on a an employer’s whim. Not because it’s not allowed by law but because fired employees can sue for wrongful dismissal, and for most employers it’s not worth the risk, so there’s usually a long HR process for firing someone for poor performance.
Termination with “cause” has special meaning in employment law. It usually means getting fired for theft, fraud, harassment, causing irreparable harm to the company, etc.
One consequence of getting fired with cause is you don’t get severance or most other protections you’re normally entitled to by law. So, the bar for this kind of termination is (rightfully) very high.
Poor performance or even not showing up for work at all generally don’t meet the requirements for “cause”, so I dunno if making it illegal to let people go for anything other than straight up committing illegal or harmful acts makes sense.