I was actually thinking about a similar question some days ago when discussing morality and ethics with some friends.
And having cheated before on an exam (it was for a useless class, so I didn't give it much attention), I think it is wrong to cheat on any exam - no matter how worthless the class is.
The way I see it, is you're essentially portraying a fake version of yourself and robbing everyone else of the truth (and also devaluing the entire process from those who actually spent time to study for the exam). Believing that it is wrong to cheat on anything in general will lead to a more honest life, and I think that will ultimately increase happiness. There are always the extreme cases though, and one can't neglect that. Suppose it's the deal breaker exam - the one that decides the fate of your future (pretty dramatic, but maybe the medical entrance exam or BAR, etc). Well, if this exam really does decide your future and you haven't prepared for it at all - what does that say about you and the future you hold? Surely if you can't prepare for the most important exam in your life, you have no business pursuing anything in that field when your spot could belong to someone who actually deserves it.