Exploration of precious-metal-free catalysts for water splitting is of great importance in developing renewable energy conversion and storage technologies. In this paper, on the basis of density functional theory calculations, we reveal the link between the oxygen evolution reaction (OER) activities and the electronic properties of pure and first-row transition-metal (TM)-doped AlN and GaN two-dimensional monolayers. We find that Ni-doped layers are singularly appealing because they lead to a low overpotential (0.4 V). Early TM dopants are not suited for the OER because they bind the intermediate species OH or O too strongly, which leads to very large overpotentials, or no OER activity at all. The late TM dopants Cu and Zn show less or no OER activity as they bind the intermediate species too weakly. Although in many cases the overpotential can be traced back to an OOH intermediate species being adsorbed too weakly compared to an OH species, the Ni dopant breaks this rule by stabilizing the OOH adsorbant. The stabilization can be correlated with a switch from a high-spin to a low-spin state of the dopant atom. This ability to change spin states offers an exciting ingredient for the design of OER catalysts.