With increasingly serious environmental pollution problems, the development of efficient photocatalytic materials has become a hotspot in current research. This study focused on phosphorus-doped carbon nitride/titanium dioxide (PCT) Z-type heterojunctions, aiming to deeply investigate their photocatalytic degradation and photosensitive antimicrobial properties. A PCT Z-type heterojunction was successfully fabricated using melamine phosphate, cyanuric acid, and titanium dioxide. The structure, morphology, and optical properties of PCT Z-type heterojunctions were explored by FTIR, XRD, XPS, BET, SEM, UV-Vis DRS, TEM, EIS, and PL. A comprehensive and in-depth analysis of the structure, morphology, and optical properties of PCT Z-type heterojunctions was carried out. The photocatalytic degradation experiments revealed that PC3T Z-type heterojunctions exhibited an excellent degradation capability for methylene blue (MB) under visible light. The effect of PC3T on the adsorption-photocatalytic degradation of MB is more than 1.5 times that of a single titanium dioxide and P-doped carbon nitride. In the photosensitive antimicrobial performance study, PC3T reduced the survival rate of E. coli to 7%, after 120 min. Through free radical trapping experiments, it was shown that the hydroxyl radicals and superoxide radicals exerted an influence on the photocatalytic process. This study offers new ideas and approaches to address environmental pollution problems and holds significant theoretical and applied value.