Say you discover something that cures cancer. Hypothetically, a big drug company would pay millions of dollars to use the technology. If you have a patent on it, they have to pay you the money because you "own" the rights to use your cure. If you've already posted something on a web site that describes what you've found, the drug company doesn't have to pay you anything because you've already released the information to the public. I will admit I'm not a patent attorney, so I may not have all the facts straight. Things work differently in different countries too.
Also, I believe strongly that scientists should share information whenever possible. I just want you to be aware that, in a few cases, keeping the information private is in your best interests.