If an employee complains to HR of harassment, it seems like the most coldly rational, protect-the-company reaction they could have would be to do everything in their power to prevent the complaint from going public and creating a PR nightmare. Taking the complaint seriously is in their power, usually make the complainant go away peacefully, and makes you the "good guy" in the court of public opinion if it comes to that.
Furthermore, given a situation where one of your staff is abusing their position in any way, I would think most companies would rather find that out from their HR department than from the local newspaper or the district attorney.
So why isn't that the default strategy for HR departments? I understand that not every HR director is necessarily competent, and that large enough power discrepancies can overcome a lot of good intentions, but it seems like best-practice HR procedure is to essentially sweep problems under the rug and hope they go away instead of making an effort to honestly address them. That can't possibly be a good long-term strategy, can it?