According to my understanding, the variation of the bandgap is because of change in energy levels that contribute to the bandgap (conduction or the valance bands) by the dopant atoms.
For example, in case of ZnO, the valance band is formed by the quantum-mechanical entanglement of 2p orbitals of all oxygen atoms in the crystal lattice and conduction band by 4s of all Zn atoms. The band gap is determined by the difference in energy between the highest valance band state/energy and the lowest conduction band state/energy. When doped with Mn, the 3d orbitals of all Mn atoms contribute to the valence band along with 2p orbitals of Oxygen. This will certainly alter the valance band Density Of States since the contributing orbitals of Mn and O are not identical. So, more the concentration of Mn in ZnO, more 3d orbitals in the valance band and thus higher the alteration or tuning of the bandgap.
It is evident that only increasing the concentration of Mn in ZnO and not the placement of the Mn in the ZnO unit cells affects the bandgap; suggesting that the mechanism of bandgap tuning does not depend on perturbation of band structure by individual dopants in individual unit cells but on the number of atoms in ZnO (Zn in particular) that have been substituted by Mn atoms.
The bottom line , according to me, is dopants alter the nature of a material thus changing its bandgap . And with large concentration of dopants, the material is almost like a new material with new properties.
Also Mn is a chief ingredient for making Room Temperature FerroMagnets out of ordinary semiconductors, thus altering magnetic properties in addition to electric & optical properties, but I believe this phenomenon is out of the scope of your question.