I'll keep the idea at a high level (not touching thornier issues like naked shorting, etc).
Taking an opposite position on a stock is necessary for accountability.
If I believe in Company A is trustworthy, putting out a good product, and has good vision for a successful vision, I can invest and hold a long position on their long term growth. Conversely, if Company B I find to be wasteful, ineffective, or has poor vision, I can take the opposite, a short position as I believe they won't do as well in the future.
Beyond price discovery, this bet against Company B is what in theory, should hold their feet to the fire to perform better in the longterm. Company B wants their stock/value to rise just as much as Company A, so they should employ effective management in order to do so.
Accurate pricing (the push and pull between long and short positions) is necessary so you don't create asset bubbles. The above can be extrapolated to investing not just in single equities, but entire sectors or markets as a whole.
For the above to work as designed, average investors need access to regulated and truthful financial reporting and the system needs to ban and punish untruthful accounting practices.