People invest in an IPO in the first place because of the promise of liquidity down the line.
If investors were told that they couldn't freely buy or sell shares after the first time it is sold, the IPO is going to do far worse.
The ability to trade the stock around directly helps the company by making the IPO more successful.
That's not even considering that the company could issue secondary offerings.
They didn't anticipate _your individual_ actions, but it's highly likely that the persons that bought into Facebook's IPO did expect that they would be able to sell the stock to _someone_ at a later date.
So, yes, people anticipated your actions now (if you look at _your_ actions as the general actions of the crowd, instead of your individual actions)
By buying Facebook stock now, you're fulfilling that expectation of earlier investors, which motivated them to provide Facebook's initial funds.
Liquidity along with higher prices along with improved business metrics, which provide perception and confidence to the market to promote higher prices, are used by the business to obtain cheaper financing and the employees of the business to also obtain access to credit based on their holdings of the stock.
These are colloquially called resources to businesses.