Ensembles of dopants have widespread applications in quantum information processing. However, miniaturization of corresponding devices is hampered by spin-spin interactions that reduce the coherence with increasing dopant density. Here, we investigate this limitation in erbium-doped crystals, in which these interactions are anisotropic and particularly strong. After implementing efficient spin initialization, microwave control, and readout of the spin ensemble, we demonstrate that the coherence limitation can be alleviated by dynamical decoupling. Our findings can be generalized to other dopants and hosts used for quantum sensors, microwave-to-optical conversion, and quantum memories.