Does trading stocks somehow cause an increase production of actual stuff? If not, I don't see how everyone ends up better off.
Sure it does. If the price of a stock changes, it becomes easier/harder for that company to raise money relative to other companies. If it's a good company then making their shares go up can increase production of actual stuff because they can afford to build more factories etc. If it's an inefficient company and its shares go down then the people who sold it can go invest that money in something else. There is a net increase in production if the company who gets the money is the one more efficient at using it to make stuff than the alternative, i.e. share price becomes "more accurate" as a measure of the company's market efficiency.
Without the government the stock market would be less crowded.