Degree spectra and immunity properties