Is it a good idea to put the logo of the university in my motivational letter? I'm applying for a master's program, and one of the required documents is a motivational letter, in which I should briefly expose the reasoning behind my choice of program.

I'm using a LaTeX template which has a nice place to put a logo, and I'm thinking about putting the university logo there. Is this allowed? Is it common? Is it a good idea?

Any help would be greatly appreciated.
No, you should not put the university logo in the letter. You are not representing your university in an official capacity in a statement of purpose, and therefore using the university's logo would be inappropriate, as you would be suggesting an official imprimatur for your work.