That kills bacteria. There can be other contaminants like chemicals and what not. Think about this. Would you take muddy, stagnant pond sludge and just boil to drink it? I wouldn't.
There are numerous ways to get drinkable water though. In addition to boiling, knowing how to make a proper filter is helpful. Distilling can be done rather easily on a small scale. And there are other small tricks like tying a plastic bag over a leafy branch that is in the sun.