Firstly the story is rubbish.
3am? Every prisoner would be locked up.
2ndly the guy had an incredible amount of energy so he was probably drugged up - note the way the pepper spray had no immediate effect, so punching him back isn't going to hurt him if pepper spray doesn't.
3rdly the guard's defence...what a shambles. Grabbing the waist is a 2 person controlling technique...he should have at least tied up the right arm at the shoulder on the ground to stop those dampen those haymakers and allowing him to tie up a leg so there was a lot less leverage for the attacks.
However, ignoring these deficiencies, the guard protected himself reasonably well under the circumstances. Someone with less presence of mind would not have been able to turn/avoid/soak up such punishment and may have been killed.