Another point not addressed in existing answers:
There is some indication that exposure to chlorinated water may increase the risk of asthma. German authories recommend avoiding chlorinated water for children under two years of age as a precaution, if there is a history of allergies in the family.
If water is chlorinated, which is the case in virtually all public pools, some amount of nitrogen trichloride is present in the air. Nitrogen trichloride irritates mucous membranes, and is what causes the "chlorine smell" of swimming pools. It is usually harmless in the concentrations typical in swimming pools, but there is some concern that it may damage children's lungs and thereby promote asthma.
In this article, the German Umweltbundesamt (German Federal Office for the Environment) recommends:
Besorgten Eltern von Kindern unter zwei Jahren, in deren Familien
gehäuft Allergien auftreten, empfiehlt das Umweltbundesamt (UBA), aus
Vorsorgegründen vom Babyschwimmen abzusehen, bis geklärt ist, ob sich
der Verdacht bestätigt. Alle anderen Kinder und Erwachsene können
Schwimmbäder mit einer Wasseraufbereitung nach den allgemein
anerkannten Regeln der Technik weiter ohne Bedenken nutzen.
Translation (no guarantees):
Worried parents of children under two years of age, and where multiple
cases of allergies have occured in the family, are advised by the
Umweltbundesamt to not take their babies to a swimming pool as a
precaution, until it is clear whether the suspicions are confirmed.
All other children and adults can use swimming pools with a
state-of-the-art water treatment system without worries.
Note that the risk is much lower with open-air swimming pools, as nitrogen trichloride will dissipate more quickly there. Also, a lot depends on the water treatment and air purification system used. If air is filtered appropriately, the level of nitrogen trichloride can be lowered significantly.