A particular company is "worth" so much. That worth is usually defined by the vast majority of professional investors as the time-value of all future earnings (or some finite horizon, like 5 years) plus the market value of all assets including land, inventory, intellectual property, trademarks, etc. less actual (accounts payable) or expected (lawsuits) amounts due. Divide that over the number of shares outstanding and voila you have a stock price.
In FB's case, the future earnings may be pretty dang low, but think about their assets: the voluntarily provided demographic specifics several HUNDRED MILLION people. That's a marketer's wet-dream. That's a huge asset that would be almost impossible to (legally) obtain in any other way, making it an incredibly valuable resource. They just haven't figured out how to /really/ tap into it without causing an uproar, thus expected earnings are low.
Love it or hate it (and I personally hate it), they do have some potential for big big earnings, even if they just hock their user list & details.