McKinsey & Co. removed a senior partner from his leadership role at the firm’s research arm after he posted online comments questioning the uphill battle female executives face in the workplace.