When chlorine gas is added to water, it forms hypochlorous acid. This hypochlorous acid is what "chlorinates" the water, killing off the pathogens in it. In the process disinfection by products are formed, some of which are harmful. The concentration of hypochlorous acid is closely regulated to minimize the risk to humans.
Calcium chlorite can be used instead of chlorine gas to form the same hypochlorous acid.