They would work want to collect dividends - in the form of higher wages or other non-monetary compensation.
So the stock market allows you to take those risks and mitigate them in near-as-possible real time.
Perhaps not in the short term, but they definitely are in the long term.
Plus then since the future is unknowable, it's tied up with investor's personal risk profiles, discount factors and some straight up sentimentality. If you have a crystal ball and can predict the future perfectly, stock prices would correlate with profits, but even if the market was perfect, current profits would be related to past stock prices, not current stock prices.
(Oh, and to make it more complicated and basically impossible to model with linear equations, if you own stock you can influence those future outcomes both directly via shareholder activism and indirectly via the effect you have on a company's cost of capital, so the whole system is dialectic.)
In addition to that, coming form a private equity holders perspective, its a way for some of us to cash out on the general market. If I had a big stake in a private company, maybe I can only sell my options every 6 months, if my company is kind enough to set that up.
If there's an IPO I can sell my stake at what is probably a higher market value than the internal price and cash out all at once (or over time)
What if they got stuck in some scandal? IPO is also a way to shield the company from action of an evil executive.
If some politician has a beef with a private business, they can potentially cause them enormous loss.
But no politician would like to take some action which might cause public losing money because of the fear of losing their support through votes.
Not only this, it's also a feedback mechanism. A company exceeds quarterly expectations, more people jump to buy their shares as a result executives sell and profit. And large companies will have projects which might take long to profit, but they can be immediately judged on their next move post IPO. How will this work in a private company?