Novel pillared-layered framework materials were synthesized by high-throughput or microwave-assisted methodology that contain Mg2+ and the zwitterionic linker HDTMP (hexamethylenediamine-N,N,N′,N′-tetrakis(methylenephosphonic acid)). Three compounds were structurally characterized by X-ray powder diffraction. In the compound {Mg[(HO3PCH2)2N(CH2)6N(CH2PO3H2)2]·(H2O)}n(1), obtained at 140 °C by hydrothermal or microwave-assisted reaction, the layers are built by isolated Mg2+ octahedra coordinated by oxygen atoms from six different zwitterionic HDTMP ligands. Each amino-bis(methylenephosphonate) moiety links three Mg2+ ions, bridging two of them through one phosphonate group and connecting the third polyhedron in a monodentate fashion. In Compound 2, {Mg[(HO3PCH2)2N(CH2)6N(CH2PO3H2)2]}n, hydrothermally synthesized at 180 °C, the layers are composed of bidentate amino-bis(methylenephosphonate) moieties connected to three Mg2+ ions, with one of the phosphonate groups acting as a bridging ligand. Various subtle structural changes are noted for the other two compounds. Thermodiffraction of 1 reveals that a crystalline-to-crystalline phase transformation occurs concomitantly with its dehydration, leading to a new anhydrous phase, namely, {Mg[(HO3PCH2)2N(CH2)6N(CH2PO3H2)2]}n(1deh). This process is fully reversible upon equilibrating the solid at room temperature. The reported compounds can adsorb ammonia and CO2. Compound 1 exhibits a moderate proton conductivity, ~1.5 × 10−5 S·cm−1 at 80 °C and 95% RH, that increases a half order of magnitude after experiencing a complete dehydration/rehydration process, 1→1deh→1.