I am not after earning money but to spread knowledge about something for free. But if money is neglected, what else can be the disadvantage of publishing it online?
There are a few potential disadvantages that I can see:
It isn't necessarily a solution to the biggest issue for new/unknown authors: getting eyes on the page (or screen, in this case). Putting something on the internet alone isn't enough to get people to read, you still need to have produced something of quality (or something so bad it's funny!), have people find it, be willing to expend the effort to read, and then recommend/link to others. It is possible, but for any given book, exceedingly unlikely (what was the last novel you stumbled across online, read in entirety, enjoyed and recommended to all your friends?). You're competing with the rest of the internet for attention spans.
Some people still consider something given away for free as being valueless (whereas of course we know that "price" and "value" are different, right?)
You've exhausted your "first print" rights (electronic ones, anyway), something that publishers may still consider valuable. That is, to get published in the traditional manner after releasing free online, you'd need to develop an enormous following to make it worth a publisher's while.
There is always the fear that "someone will steal my work". I think the chance of this is happening in any meaningful way is vanishingly small, but it is a concern a lot of people have. People do copy and re-post things on the internet, so it definitely happens, but if your work was copied and then got popular from someone else, a) at least it's popular (which is really your goal?), and b) when the internet† sees something it considers "a wrong", it is quite good at investigating and outing the truth (a process which -- if it happened -- would likely generate an order of magnitude more publicity).
Costs associated with production, hosting and maintenance (as Bruce mentioned above).
As a postscript, putting something online for free doesn't mean you can't make money. There are lots of business models you can look at: support via donations or "pay what you want"; popularity can open new opportunities for employment, expert comment, speaking, etc; selling physical goods to go along with the electronic (high quality print versions, for example). There are many others, I'm sure.
† Yes, I referred to the internet as if it's a conscious entity in it's own right. It is, isn't it? ;)
When I see that a novel has the imprint of a professional publishing house, I know that some editor actually convinced his or her boss that this book was worth paying the author money up front, in the expectation that other people would buy the book once it was published. That’s certainly no guarantee of quality, but it does narrow down the field. Book reviewers feel the same way, so if I rely on reviews to decide what I should read next, those reviews are going to point me at a professionally published work.
There are more books for sale plus books in my public library plus public-domain work from Gutenberg than I could possibly keep up with. And then there are eleventy-gazillion works of contemporary fiction that other people are offering to the public for free. I’m sure some of those free books are actually worth reading, and if someone whose taste I respect gives me a nudge and says “you should read this”, I’ll check it out. But otherwise, why should I make the effort to sift through them?
I think one of the greatest disadvantages is, that the web is not considered to be a media for professional publishing. There are some great books published on the web (for example Butterbrick’s Practical Typography) but most content cannot compete with printed books.
So no matter how much you know about your topic, if your website doesn’t look professional, many readers could think your content isn’t as good as something in a book.