I think that from a practical perspective, churches should NOT invest in the stock market. It creates too many opportunities to have a conflict of interest, and investing, in general, is not a church's area of expertise nor does it have anything directly or indirectly to do with soul-winning or edifying the body of Christ. There are also a few principles involved that could be compromised. I'm too sleepy right now to get into that.
As far as a Biblical perspective... I can only say that it's not explicitly unBiblical, but I wouldn't hesitate to advise against it. If I had a client or pastor who insisted, I would recommend buying some US Savings Bonds instead, a mutual fund, money market, or something else that is safer and lower-risk than the stock market. I don't think there's much wrong with churches investing, but I would avoid having them invest in the stock market.