Having an IPO doesn't mean free money for the company. Otherwise, everyone would have an IPO. There are drawbacks that come with the new capital raised through an IPO.
The most obvious cost of having an IPO is the expense. It costs money to raise money. The legal fees, printing costs, and accounting fees associated with registering an IPO can run into the hundreds of thousands of dollars. On top of those costs, the rules for taking a company public are so complex that most companies have to hire experts to handle all the paperwork. And once the IPO has happened, the costs don't end. The SEC regulations on public companies mean that the CEO of the company will either have to devote a lot of extra time to dealing with those regulations (plus the demands of profit-hungry shareholders) or hire someone else to do it.
Speaking of shareholders, they are another drawback of going public. The primary owners are no longer in a private company that can make independent decisions. The investors who purchased stocks at the IPO own a certain percentage of the business, and their demands cannot be ignored, even if they don't have a controlling interest (more than 50 percent of the shares) in the company. SEC regulations require shareholder notification, meetings, and approval for certain business decisions. Shareholders also want to see the value of their stocks rise, so if the stock price drops or remains stagnant, the company will have to deal with unhappy part-owners. If they become unhappy enough, they may sell their stocks, which will cause the value to drop further, decreasing the overall value of the company.
Public companies are also open to public scrutiny. Quarterly financial reports, internal transactions, and balance sheets are all open to inspection. This is more of a problem for some companies than others, particularly companies who might have made illegal deals or altered financial reports. To learn about what happens when public scrutiny discovers improper financial dealings, read Open Spaces Quarterly: The Enron Debacle, by Steve McConnel.