A social-network furor has erupted over news that Facebook Inc., in 2012, conducted a massive psychological experiment on nearly 700,000 unwitting users.

To determine whether it could alter the emotional state of its users and prompt them to post either more positive or negative content, the site's data scientists enabled an algorithm, for one week, to automatically omit content that contained words associated with either positive or...