HR is certainly working for the company, but the whole point is that they help mediate issues to avoid litigation. In order to do this, they need to provide as much assistance to employees as possible. In fact, it's in the company's best interest for their HR department to offer as much help as possible to employees.
If a HR department just brushed off complaints, it could be catastrophic for the company if that employee took legal action.
Your view of HR is extremely narrow.