TL;DR: Fetal lungs are filled with lung fluid produced by lung epithelial cells, not amniotic fluid. Amniotic fluid aspiration in utero can be catastrophic. So your question is based on an inaccuracy.
Why does water damage the lungs but amniotic fluid doesn't?
My question back to you is, how do you know that amniotic fluid isn't harmful to fetal lungs?
There is a common misconception that fetal lungs are filled with amniotic fluid. In fact, it's so common that even many physicians mistakenly believe this.
From a book chapter titled Amniotic Fluid: Physiology and Assessment published in 2008, this misconception is discussed briefly:
Because amniotic fluid is more hypotonic than fetal plasma, it is postulated that exposure of amniotic fluid to the fetal alveolar capillary bed results in net movement of water from the amniotic cavity into the fetus. Although radioisotopes have been discovered in fetal lungs after intra-amniotic instillation, this quantity has been small and inconsistent,2 leading investigators to question the actual contribution of fetal respiration to amniotic fluid removal. In fact, surface-active phospholipids originating from the fetal alveoli are found in the amniotic cavity, leading to suggestions that the fetal lungs may actually be a net contributor to amniotic fluid volume.
This, in 2008, despite the fact that fetal lung fluid was shown to be produced by fetal lungs in 1948. (That paper, unfortunately, is unavailable.) By 2018, that misconception was corrected in medical textbooks, e.g. Avery's Diseases of the Newborn, Tenth Edition (2018) in which can be found the following:
Fetal lung fluid is a product of the epithelial lining of the developing lung (Wilson et al., 2007; Helve et al., 2009), averaging 4–6 mL/kg per hour. The resistance imparted by laryngeal abduction results in fluid accumulation to a total volume of 20–30 mL/kg during gestation, which generates an end-expiratory pressure of approximately 2–4 cmH2O. The composition of fetal lung fluid is distinct from that of both amniotic fluid and plasma, as illustrated in Table 42.2.
More succinctly:
During fetal life the lung develops as a liquid-filled organ. This liquid is produced by the fetal lung and leaves via the trachea from where it is either swallowed or enters the amniotic sac. Fetal lung liquid plays a crucial role in the growth and development of the lungs by maintaining them in a distended state.
Fetal lungs produce fluid that keeps the lungs expanded and developing normally. Though there is evidence of diaphragmatic activity as early as 12 weeks gestation, amniotic fluid does not enter the lung with these diaphragmatic movements because the fetal larynx closes during "inhalation" preventing the entrance of amniotic fluid. When it relaxes, a small amount of lung fluid escapes the trachea, some of which is swallowed, and the rest contributes to amniotic fluid.
Fetal breathing movements contribute to the efflux of lung fluid into the AF, but about half of the effluent is swallowed rather than entering the AF.
Amniotic fluid aspiration in utero can cause death because amniotic fluid is loaded with keratinized epithelial cells from the baby's skin and other things that can injure the lungs.
Before the baby's first breath, all the fetal lung fluid is quickly absorbed by the lungs into the interstitial space, allowing for air to enter the lungs.
Edited to add: You wanted a specialist to answer this question. Well, here is a letter to the editor of Pediatric Pulmonology, a journal about the lungs you referred to in your question, from a Neonatologist, entitled Fetal lung fluid: Not the same as amniotic fluid. In it, the Neonatologist corrects a mistake by another Neonatologist in one of the articles in this specialty journal! So it shouldn't be a surprise that so many others get it wrong, too.
An exerpt:
However, I wanted to bring attention to a statement in the introduction where the author states that the “preterm infants’ lungs are filled with amniotic fluid”. This is not accurate and appears to be a common misconception, particularly among medical students and junior residents despite recognition of fetal lung fluid as being a separate entity from the amniotic fluid as originally described in 1948 by Jost and Policard.