The departure comes as the social network has faced some of the biggest scandals in its history.