Protection of excited spin states by a superconducting energy gap