The first-principles calculations based on density functional theory are performed to study F-, Cl-, and N-related defects of amorphous SiO2 (a-SiO2) and their impacts on carrier trapping and proton release. The possible geometric configurations of the impurity-related defects, the formation energies, the hole or electron trapping of the neutral defects, and the mechanisms to suppress proton diffusion by doping N are investigated. It is demonstrated by the calculations that the impurity atoms can interact with the oxygen vacancies and result in impurity-related defects. The reactions can be utilized to saturate oxygen vacancies that will cause ionization damage to the semiconducting devices. Moreover, the calculated formation energy indicates that the F- or Cl-related oxygen vacancy defect is a deep hole trap, which can trap holes and prevent them from diffusing to the a-SiO2/Si interface. However, three N-related defects, namely N(2)o–H, N(2)o=O, and N(3)o–V o, tend to act as shallow hole traps to facilitate hole transportation during device operation. The N(2)o and N(3)o configurations can be negatively charged as deep electron traps during the oxide charge buildup after ionization radiation. In addition, the nudged elastic band (NEB) calculations show that four N-related defects, namely N(2)o, N(2)o–H, N(2)o=O, and N(3)o are capable of capturing protons and preventing them from diffusing to and de-passivating the interface. This research reveals the fundamental properties of the F-, Cl-, and N-related defects in amorphous silica and the details of the reactions of the carrier trapping and proton release. The findings help to understand the microscopic mechanisms that alleviate ionization damage of semiconducting devices by doping a-SiO2.