Why aren't grant applications systematically published online, regardless of whether they are accepted?
Confidentiality is a real issue.  In an ideal world, ideas could be shared freely, and this would enhance the flow of knowledge and the progress of science and other research endeavors.  However, we live in a world with limited resources.  In particular, there is a shortage of grant funding.  Most grants do not get funded.

Consider the following scenario:  A researcher has some very interesting preliminary data, and they want to get a chance to follow up and do a more full study.  So they apply for a research grant from some agency.  If their proposal is not funded, but the content of the proposal is made available online, other researchers may troll through and pick up on the idea.  If another scientist with access to more resources sees the proposal and decides to do the follow-up work themselves, this robs the person who originally had the interesting idea and started the project of a fair shot at completing it and getting adequate credit for it.

Sometimes, having a good idea for something to study is the hardest part of the research process.  I personally have some ideas for projects that I do not want widely disseminated, because I would like to do them myself at some point, but I don't have the time and resources I need right now.  They do not involve urgent questions that really need to be answered, so there is no great loss if these avenues are not pursued promptly.  Thus I feel justified in keeping some of my best ideas confidential.