I kind of get annoyed when this statement is bandied about. Not because it's false, but because it's brought up in cases like this one where if HR were actually doing their job well, they would have protected the company by doing a real investigation.
That is, one of the primary purposes of HR is "keep the company from getting sued." But, in many cases, that goal aligns with someone who has a valid, verifiable complaint. For example, if you are being sexually harassed and want it to stop, a good HR team will absolutely do their best to make that happen, because if they don't they are opening the company up to huge liability.
Not saying everything is always 100% cut and dry (particularly when the accused is somewhere very high up and the company thinks it would cause great disruption to fire them), but reading through the details on this case, that doesn't really appear to be true. I'm certainly not making a judgement since we've only read one side of the story, but I do push back strongly against the idea that HR didn't intervene because they wanted to protect the company.