Why does Facebook not need to produce particularly high-quality software?
By paying less attention to quality, Facebook has been able to focus on other things, like making the company a fun place to work at that can attract and retain talented engineers. Facebook would probably be less fun if it cared more about quality.
Facebook's product is a website, so it can fix things quickly. It has a process which permits rapid deployment of new code, and rapid rollback of buggy changes. This reduces the cost of recovering from bugs.
Facebook's product has a lot of momentum and lock-in. The barrier for users or businesses to move off Facebook is very high. This gives Facebook a wider margin of error to ship glitchy software. If Google was broken for a day, you'd probably go to Bing and might not come back. If your iPhone pissed you off all the time, you'd probably buy an Android when you're faced with the decision in a year or two. If you can't order something on Amazon, you can order it from somewhere else. If Facebook is broken, you keep coming back until it works again.
I'd say that Facebook's acquisition of top talent has much more to do with them having huge pre-IPO monetary incentive and less to do with being a "fun place to work".
Any impediment to shipping code makes things less fun for many developers.
Because "fun place to work" obviously means beer and bongs passing around, in-office swimming pool, bikini models, pool and air-hockey tables, and Futurama watching marathons.
Which doesn't result in the highest quality products, if any products at all.
Not saying the stuff associated with quality is bad -- quite the opposite -- but (at least to me) that part isn't particularly fun.