crescent - re "who the market works for and why."
I think you need to have a minimum understanding of how markets work in order to ask these questions and really understand the answers.
"The market" you are referring to, I presume, is the stock market. It is there so companies can finance their big projects/future growth/whatever through selling shares (= equity) in an IPO (Initial Public Offering). It is also there so that investors who buy those IPO shares can then sell to others, and they can expect to sell to others, etc. If there was no secondary market in those shares, nobody would buy IPO shares and companies could not raise money through selling their shares to the public.
There is also the bond market, where companies can sell debt obligations - i.e. "You give my company money, and I will pay you x interest over y years, then pay back your initial investment". This is another way of raising money for a company, if owners don't feel like selling part of it. Once company's debt is out in the bond market, its price and interest rate fluctuate according to (1) time (how close you are to maturity) and (2) demand (how risky your company is perceived to be at any point in time). Again, this secondary market (where bonds are traded) is necessary so investors can sell them when they want to. Again, they would not have bought them otherwise.
So that is why markets work - so large companies can be financed.
It also works for reasonably knowledgeable investors like me, who want to invest in their future prospects. If you don't know anything about them or don't want to be involved, nobody is twisting your arm to buy a share or a bond.
"It's certainly not for the good of society"
Not everything can be a charity. And financial markets are not there to help the elderly across the street, build libraries or whatever else you mean by "the good of society". They are there for the purpose of raising large amounts of money, without which companies cannot grow beyond a certain point.
But I don't care about companies' growth, I care about the good of society, I hear you say
Well, what is going to happen to the society if companies don't grow - i.e. economy doesn't grow? Where will those people work? And if the majority can't work & pay taxes, who will pay for the NHS, education, social housing, and all those other things which I assume you would classify under stuff that is "for the good of society"?