That's exactly right. Toby's job was to protect the employees and, by extension, the company. That means that he's supposed to intervene in situations that could result in lawsuits against the company. But Toby, while well-versed in HR duties, does not have the ability to stand up to Michael. It's quite likely that he doesn't get the support from Corporate that he needs. Michael wants to say whatever he wants, whenever he wants, to whomever he wants, regardless of how inappropriate it is. Corporate clearly tolerates this as I find it hard to believe that no one has ever complained to them about Michael (or Todd Packer). We even get a scene in Season 3's "The Job" where even David Wallace complains about Corporate's HR guy, Kendall. This is the same Kendall who, in season 5's "Business Ethics" doesn't think Meredith's sleeping with a supplier for Outback gift cards is a big deal...because it benefits the company.
The fish rots from the head down. Corporate tolerates Michael and doesn't back up Toby, Michael resents Toby trying to tell him what to do, but knows he won't generally be held accountable for his actions. This means the Scranton employees work in a hostile environment rampant with sexism, racism and a boss who invades their privacy and abuses his power.