In the last two months, Mark Zuckerberg has had a rude introduction to the capital markets. The founder of Facebook has always seemed fearful of the stock market and tried to avoid the trading hordes as long as possible, but that has turned out to be a huge mistake.

Before taking Facebook public in May, the 28-year-old Zuckerberg had led something of a charmed life. The roadblocks he faced in building the world's biggest social-networking company were tiny, like an overdramatized civil lawsuit. Now, with Facebook's stock in free-fall, down more than 40% from its IPO price, Zuckerberg has a big problem.

Zuckerberg did not want to deal with the pressures of being a public company. Like many entrepreneurs these days he viewed the capital markets with suspicion. The view in Silicon Valley, as recently described by Marc Andreessen, co-founder of venture capital firm Andreessen Horowitz, is that laws that Congress passed in response to the first Internet bubble, like Sarbanes-Oxley, make it “incredibly difficult to be public today.” So Zuckerberg made a fateful decision, he decided to keep Facebook a privately-held company for much longer than other success stories like Google or Amazon.

But Zuckerberg still needed money. He needed financing for his plans and to compete with the likes of Google or the next dorm room dreamer to come along. He also needed to attract and retain talent. Issuing stock options, or, in this case, restricted stock units, that don’t turn into cash money for years was not enough. To solve this problem, Zuckerberg turned to venture capitalists, hedge fund managers, even a Russian oligarch. But those investors also expected to cash-out and those pesky securities regulation also limited the number of shareholders Facebook could have and still remain a private company. By May 2012, Zuckerberg had no choice but to launch an IPO.

Waiting eight years to conduct an IPO, however, has turned out to be an impossible problem to manage. The hype associated with the hottest company in Silicon Valley had created massive expectations and lots of shareholders with tons of stock looking for an exit. The bankers at Morgan Stanley applied all the lessons of the last 15 years and priced the IPO at $38, which was very aggressive, in an attempt to avoid leaving any money on the table and the embarrassment that a huge IPO pop would represent. David Ebersman, Facebook’s chief financial officer, increased the size of the offering at the last minute to try to mitigate future selling of shares from early investors and employees.

With such a big valuation at IPO time, Facebook had to show some results. But the numbers that Facebook announced on Thursday in its first quarterly earnings report were underwhelming. Zuckerberg, Ebersman and Facebook COO Sheryl Sandberg did not inspire much confidence about their business model in a conference call. The trading hordes drove Facebook’s stock down by 15% in Friday morning trading. "We're disappointed about how the stock is traded but the important thing for us is to stay focused on the fact that we're the same company now as we were before," Ebersman said.

But that is going to be very hard to do. Facebook headquarters in Menlo Park, Calif., is not a kibbutz. The employees that joined the company are like all the other creatures in Silicon Valley; they want to get rich. It’s hard to imagine morale at Facebook won’t take a hit that correlates with the loss in value of the shares belonging to the employees. And things don’t look promising for the stock short-term given that the employees, ex-employees, hedge fund managers, venture capitalists and Russian oligarchs that held pre-IPO Facebook stock will be freed from their post-IPO stock lock-ups starting in August. Make no mistake: the early institutional investors are heading for the exits.

The lesson of the Facebook fiasco for Silicon Valley is clear. Start-up entrepreneurs cannot evade the discipline of the capital markets any more than can the prime ministers of Spain and Italy. The markets have a way of focusing the mind. Zuckerberg & Co., might have not been so late to embrace mobile or might have had more urgency to develop a monetizing strategy had Facebook faced the trading hordes earlier. As New York hedge fund manager Dan Loeb recently demonstrated with his intervention at Yahoo!, Wall Street and Silicon Valley need each other. Zuckerberg thought shielding himself from guys like Loeb would help him build a better company, but that is not what tech entrepreneurs will take away from his example.