I'm currently studying this in Literature class!
Well, Malvolio was pretty stuck up and conceited, so I can understand the other characters wanting to teach him a lesson. Especially in the scene when he finds the letter and reads it, and starts saying how he would benefit from marrying Olivia - he takes himself WAY too seriously.
However, I didn't like that Maria played with his feelings; that is, she tricked him into thinking someone was in love with him when they were not. I suppose that was the only way the trick could be successful though. Personally, I would feel awful if someone played such a trick on me, and my confidence would take a serious hit. But, I am sometimes oversensitive, haha.
The trick did give the play the comedic feel though - especially when Malvolio wore yellow stockings and would grin like an idiot around Olivia!