The water doesn't really filter anything. That's very popular folklore. What it does do is catch the larger particulate matter in the smoke. That's the drity gray stuff that turns the water nasty and which would otherwise end up in your lungs. A lot of nasty stuff still ends up in people's lungs, however. Inhaling any sort of combustible vegetable matter is not beneficial for people's lungs or hearts, despite what some people may tell you. THC and CBDs alone, the isolated active ingredients in cannabis, are themselves beneficial chemicals and possess anti-inflammatory and broncho-dilating effects, but the problem is that in inhaled cannabis smoke, people are getting a lot more than the active ingredients.

Granny Storm Crow is correct. If you're looking to ingest the beneficial ingredients in cannabis and protect yourself from the harmful ones, a vaporizer is the way to go.