That's a totally separate question from the what their pay should be in normal times. However, if government jobs are insulated from downturns, that provides an incentive to hold such jobs at a lower pay rate than what would otherwise be acceptable in the good times. Yoyoing teacher pay up and down in sync with the economy can thus end up being a penny wise, pound foolish type measure in the long run.
True, that is a good point. I don't think their pay should go down and up in a "yo-yo" way, but freezing raises in hard economic times doesn't seem too bad to me.