* The projects directly help their business operations; those engineers might be doing the same work, anyway, even if Facebook were zealously closed source.
* Open source work gives the company image a boost in the minds of potential employees. This expands the labor pool, reducing the wages FB needs to pay, and helps give FB access to talent it otherwise simply could not have. In this case, hiring engineers to work on open source projects is little more than a PR campaign targeted at people like you and me--and it's clearly working on you.
The "good deeds" of their open source work are entirely accidental; the whole point of employing engineers to work on open source libraries is to help their business, which is inherently exploitative.
I agree with lancewiggs: by working at Facebook, your friends are aiding and abetting one of the most unethical and socially-dangerous companies in modern times. Think less of them.