Heavy metal contamination, associated with the increase in industrial production and the development of the population in general, poses a significant risk in terms of the contamination of soil, water, and, consequently, industrial plants and human health. The presence of ecotoxic heavy metals (HMs) thus significantly limits the sustainable development of society and contributes to the deterioration of the quality of the environment as a whole. For this reason, the stabilization and immobilization of heavy metals is a very topical issue. This paper deals with the possibility of the simultaneous immobilization of heavy metals (Ba2+, Pb2+, and Zn2+) in mortar based on magnesium potassium phosphate cement (MKPC). The structural, mechanical, and hygric parameters of mortars artificially contaminated with heavy metals in the form of salt solutions were investigated together with the formed hydration products. In the leachates of the prepared samples, the content of HMs was measured and the immobilization ratio of each HM was determined. The immobilization rate of all the investigated HMs was >98.7%, which gave information about the effectiveness of the MKPC-based matrix for HM stabilization. Furthermore, the content of HMs in the leachates was below the prescribed limits for non-hazardous waste that can be safely treated without any environmental risks. Although the presence of heavy metals led to a reduction in the strength of the prepared mortar (46.5% and 57.3% in compressive and flexural strength, respectively), its mechanical resistance remained high enough for many construction applications. Moreover, the low values of the parameters characterizing the water transport (water absorption coefficient Aw = 4.26 × 10−3 kg·m−2·s−1/2 and sorptivity S = 4.0 × 10−6 m·s−1/2) clearly demonstrate the limited possibility of the leaching of heavy metals from the MKPC matrix structure.