We conducted theoretical calculations to examine the energetic stability of pristine aluminum nitride (AlN) and N-defected AlN nanosheets, along with their structural, electronic, and optical properties, utilizing density functional theory. Furthermore, we explored the adsorption properties of BF3 and ClF3 toxic gases on both pristine AlN and N-defected AlN nanosheets. Our findings reveal that the N-defect on the AlN nanosheet enhances the gas adsorption energies (−1.354 and −13.263 eV) compared to the pristine AlN nanosheet. Additionally, the absolute value of the bandgap for the N-defected AlN nanosheet increases to 3.032 eV, exceeding the 2.997 eV value of the pristine AlN nanosheet. The gas molecules suffer significant deformation due to their interaction with adsorbents. Upon BF3 gas adsorption, the bandgap of the N-defected AlN nanosheet diminishes to zero. Moreover, the recovery time after gas adsorption on the N-defected AlN nanosheet surpasses that of the pristine AlN nanosheet. Both adsorbents showed a high absorption coefficient of over 104 cm−1 in the UV region. Significant peak shifting in the optical spectra of the N-defected AlN nanosheet was observed due to gas adsorption. The pronounced changes in structural, electronic, and optical properties following toxic gas adsorption suggest that N-defected AlN nanosheets are suitable for the adsorption (dissociation) of BF3 (ClF3) gases.