Is it possible to recover after a career setback such as this?
The situation you describe is unfortunately common. It is an unfortunate reality that the number of people well qualified for research jobs is greater than the number of jobs.

A few notes:


Hiring committees will be looking for good publications, and for recommendation letters coming from leaders in the field attesting to your husband's impact and further potential. If he continues to do good research, publish it in well-known venues, and speak about it at conferences, then he has a good chance. If not, then unfortunately he is competing with people who are.
Most of the complaints you mention are common at research jobs as well. I teach at a large state university, where we have our share of poorly prepared students, and/or students who are just going through the motions. Indeed a Harvard professor once quipped to me that "we have remedial classes here, too". 
I do know people who have successfully moved from one teaching position to a different teaching position, and been much happier afterwards. Some departments have more motivated students, pay better, and/or do a better job of keeping the paperwork down, and your husband could look for one of these.
I know people who have taken a variety of non-academic mathematical jobs, and for the most part they are quite happy with them!


The bottom line is that your husband can probably get a research job if he can sustain a very strong research program during the interim. Otherwise, there are likely to be appealing alternatives as well.

Good luck!