I've solved the problem for my own use. The problem for me was a glitch in gmail itself. Elsewhere the question was asked, does this behavior happen with messages sent from the gmail web interface as well? If those messages are also showing up in your gmail inbox, it's probably not a Mail fault. Check your gmail filters for the following:
When you use a filter with the "never send to spam" option enabled
that is (accidentally perhaps) matching message you send, they will
show in the Inbox.
This is considered by some to be a gmail bug. The solution is:
The filter does the same thing as the "Not spam" button, which puts
the selected conversations in the Inbox. You can exclude sent mail
from your "Never send to spam" filters by including "-me" in the From
field, or by adding "-from:me" in the "has the words" field.
In my experience it is not necessary to fully comply with Google's recommended settings for IMAP accounts, namely that you should uncheck the box to "Store sent messages on the server." I very much want to leave this selected, and having it selected is now working fine for me, now that I have added the "-me" exception to the misbehaving filter.
Refer to these threads for further background: