I cannot configure Mail 5 on Lion to work the way I want with Google GMail
Gmail is not exactly IMAP so needs some manual configuration

You need to go in Mail to the folders under your Gmail account and on Trash/Sent Messages/Deleted Messages/Junk select each one of these and then in Mail choose Mailbox > Use This Mailbox For the corresponding Draft/Sent/Trash/Junk.

I originally did this from a very clear set of instructions that I cannot find now. However another set are here.

I also go to the web Gmail Settings and turn off the Show in IMAP check box for the All Mail tag. This means that I only sync one copy of each mail to the Mac.