The electronic structure, magnetic properties, and mechanism of magnetization in two-dimensional (2D) aluminum nitride (AlN) monolayer doped with nonmagnetic elements of group 1A (Li, Na, K) or group 2A (Be, Mg, Ca) were systematically investigated using first-principles studies. Numerical results reveal that the total magnetic moments produced by group 1A and group 2A nonmagnetic doping are 2.0µ B and 1.0µ B per supercell, respectively. The local magnetic moments of the three N atoms around the doping atom are the primary moment contributors for all these doped AlN monolayers. The p orbital of the dopant atom contributes little to the total magnetic moment, but it influences adjacent atoms significantly, changing their density of states distribution, which results in hybridization among the p orbitals of the three closest N atoms, giving rise to magnetism. Moreover, the doped AlN monolayer, having half-metal characteristics, is a likely candidate for spintronic applications. When two group 1A or group 2A atoms are inserted, their moments are long-range ferromagnetically coupled. Remarkably, the energy of formation shows that, if the monolayer has been grown under N-rich conditions, substitution of a group 2A atom at an Al site is easier than substitution of a group 1A atom.