Yes. If your study is done with federal money and at a research institution you need the Institutional Review Board to clear your experiment. One of the requirements is that patients/subjects be given a consent form and the experiment explained to them.
It is possible to perform an experiment, hiding its real purpose, if the results of the experiment require the subject not to understand the design/aim. But usually these are badly designed experiments, because you can never know if a subject has been exposed before to the experiment, and can therefore game it.
I guess FB is arguing that users gave informed consent when they signed up for facebook. I don't know if there is a review board for experiments at FB.
I think, with a good enough lawyer, you can successfully execute a class action lawsuit if you find users whose mood worsened as a result of this (a user under treatment for depression, for example, whose mood is clinically assessed)
The standard for psychological experimentation would normally be informed medical consent, not the terms and conditions of a commercial contract.
This is the sort of thing that a clinical psychologist could lose their license for.