The parent company of Facebook and Instagram says the firms used its platforms to spy on human rights activists, government critics, celebrities and journalists in more than 100 countries.