The effect of 3d transition-metal (TM) atoms (Sc-Ni) substitutional doping on the structural, electronic and magnetic characters of PC6 (TM@PC6) is systemically investigated by first-principles calculations in the framework of density functional theory. Our calculations show that introducing of V, Cr, Mn and Fe atoms makes the original non-magnetic PC6 changing into ferro-magnetic, while Sc, Ti, Co and Ni atoms substitutional doped PC6 are still non-magnetic. The magnetic behavior can be qualitatively interpreted by a simple model, which associated with hybridization between the 3d orbitals of TM atoms and the defect levels of unrelaxed D3h symmetrical P vacancy, i.e., hybridization model. The occupation of electrons in hybridized electronic levels determines whether the doping system is magnetic: when the bonding levels (for Sc@PC6 and Ti@PC6), the nonbonding levels and antibonding levels (for Co@PC6 and Ni@PC6) are fully occupied, the corresponding doping systems have no magnetic, while when the nonbonding levels and the antibonding levels (for V@PC6, Cr@PC6, Mn@PC6 and Fe@PC6) become partially filled, these systems exhibit localized spin moments of 1-3 mu B. The results are helpful to understand the origin of magnetism in TM@PC6 and provide a theoretical basis for potential applications in spintronic devices.