Why did Maria play a trick on Malvolio?

(Twelfth Night: Shakespeare)