There's a theory swirling around that Duck Guy was actually originally supposed to be one of the teachers (Based on the scene in which Red Guy momentarily brings him back to life while experimenting with the machine). Duck Guy was once a teacher created by the machine that was meant to torture Yellow Guy and Red Guy - however, something went wrong and Duck Guy decided to become friends with them. He was probably meant to teach them a lesson about animals or something, because he's the only main animal character in the series. When he became more aware of things and decided he didn't want to contribute to the psychological torture, Roy decided to punish him by killing him in a very gruesome way. I'm just throwing it out there.