I actually didn't expect the virus to drastically disrupt the long term profit trajectories of many publicly traded companies, so even though I'm surprised the recovery of the market has been this strong, I am only surprised because I figured the irrational fear of the stock market would last longer than it has.
To answer the question in the thread title, the stock market is to provide a system whereby a company can borrow money and pay back those loans, where the lender is individual investors and all their investment dollars in aggregate. If you agree that it's good for a company to be able to borrow money from average joes in order to invest in growth and allow those average joes to participate in the future profits, then the stock market is just the logical consequence of such a system.