In this paper we report the synthesis and structural characterization of the 2D layered coordination polymer Mg(BPMGLY)(H2O)2 (BPMGLY = bis-phosphonomethylglycine, (HO3PCH2)2N(H)COO2−). The Mg ion is found in a slightly distorted octahedral environment formed by four phosphonate oxygens and two water molecules. The carboxylate group is deprotonated but noncoordinated. This compound is a useful starting material for a number of topotactic transformations. Upon heating at 140 °C one (of the two) Mg-coordinated water molecule is lost, with the archetype 2D structure maintaining itself. However, the octahedral Mg in Mg(BPMGLY)(H2O)2 is now converted to trigonal bipyramidal in Mg(BPMGLY)(H2O). Upon exposure of the monohydrate Mg(BPMGLY)(H2O) compound to ammonia, one molecule of ammonia is inserted into the interlayer space and stabilized by hydrogen bonding. The 2D layered structure of the product Mg(BPMGLY)(H2O)(NH3) is still maintained, with Mg now acquiring a pseudo-octahedral environment. All of these topotactic transformations are also accompanied by changes in hydrogen bonding between the layers.