This is one of the biggest bugs in OS X 10.9. It affects both Gmail accounts and Google Apps email accounts, and I urge everybody to PLEASE submit feedback to Apple on this bug at:
http://www.apple.com/feedback
You can tell Apple something along the lines of what I told them: "I wanted to alert you to a relatively large bug in Mavericks’ Mail app, which affects Gmail accounts and Google Apps email accounts. This used to work just fine in previous versions of OS X, so it is a brand new problem in Mavericks: Mail can’t delete messages from the Inbox unless Google’s “All Mail” folder is visible in Apple Mail. If you try to delete a message from the inbox, the message only disappears temporarily, then reappears moments later. It seems like Apple Mail never removes the “Inbox” label from the deleted messages, so the messages just keep reappearing back in the Inbox over & over again."
However, displaying the "All Mail" folder in Mail is
NOT an acceptable solution for the following reasons:
(1) Making the “All Mail” folder visible in Apple Mail will suddenly make dozens of gigabytes of emails start taking up valuable hard drive space, because every single email that has ever been archived on Gmail/Google Apps will suddenly be written to the Mac’s hard drive. This can be a real problem on a machine with a small hard drive, such as the MacBook Air. Hiding the “All Mail” folder prevents these messages from taking up valuable hard drive space. For example, on my own hard drive, in order for me to workaround this bug, I enabled the "All Mail" folder and then I lost 20 GB of valuable space on my hard drive, because I have 20 GB of email in my "All Mail" folder. Worst of all, all of that mail is DUPLICATED... because all that mail lives in ALL OF MY OTHER IMAP folders! The "All Mail" folder is nothing but DUPLICATED EMAIL!
(2) Whenever the “All Mail” folder is visible, every new message that comes into the “inbox" also shows up as a new message in the “All Mail” folder as well, so new messages appear like they are coming in twice. Also, users are forced to mark their messages as “read" in two locations: the “Inbox" AND the “All Mail” folder.
The ideal solution would be for Mail to operate how it used to operate: Users should be able to delete messages from the Inbox, without having the “All Mail” folder visible in Apple Mail.
Please voice your concerns to Apple, so they can hopefully fix this terrible bug!