It's clear from the story that no "learning" from the exam occurred. Students just copied the answers. Remember, this is a multiple choice exam, so this means question 42 - D, question 43 - A, etc -- nobody is looking up what this even means. According to the teacher, the answers should obviously wrong to anybody who knows the material.
Although it's very funny that this happened on an ethics course, the "is it ethical to cheat on an exam if you learned the material" question doesn't even apply here imo