The OP's question is very legitimate, I think.
Say you're a 17th century boat owner and you want to do a trip from Antwerp to Indonesia, but you haven't the money to finance it yourself. You would do what is now called an IPO (also begging for 'limited liability' for your company, in case the vessel crashes somewhere). Return would be 50% or so for each shareholder, but obviously only if the ship makes it back to Antwerp with its precious cargo.
You need a 'market' to sell your idea. Hence the "Exchange".
Say you're the British government anno 1815 and you want to continue waging war with France. You emit government bonds @ 4% return, repayable after ten years. There needs to be a 'market' on which to sell those things. Hence, again, the "Exchange".
If there is such a market, some subscribers may want to sell such bonds before the end of the ten-year period, or may want to sell their share in the expedition to Indonesia before the vessel is back in Europe, for whatever reasons. Makes sense that there is then a market for that also. No problem, all of that helps trade and government, in the end, and can easily be done on the "Exchange". A rise in share price will help the shipowner get even more money, for less dividends, on his next trip; a rise in the price of government bonds will allow the government to issue new bonds at a lower interest level. And, importantly, vice-versa of course! All of this is good for both the market and for the companies or governments needing such capital.
Does holding short or long positions, or trading in options, help companies or governments? Of course not. That's pure gambling which could lead to either bubbles or crashes, unrelated to the real economy of the underlying companies/governments, but perfectly capable of creating a crisis. Buying/selling is for a large part also computer-driven today (and those computers can react in a split second to what other computers "decide" in a split second), which accentuates the dangers of bubbles and crashes.
Should we forbid such gambling (e.g. by requiring that anyone must hold on to his shares for 30 days, 30 minutes, or even 30 seconds)? We probably should, as probably even 30 seconds would help.
Can we? Of course not. Any market inventing such rules would become obsolete tomorrow, and replaced by a more 'free' market in another country.
We now live in a 100% global financial world, with a 100% impossibility to have global laws on issues such as this 'gambling'. The result is, and will stay, anarchy, except if we mandate supra-national bodies such as the U.N. to do something about it, and allow it to enforce its decisions.
Won't happen tomorrow, I fear.
Just my 2p.