When using Mail with Gmail IMAP, how to move emails to different folders and not label them?
Gmail has a guide on how actions on IMAP clients correspond to Gmail actions. In order to remove items from your inbox in Gmail, you will need to delete them from your inbox in Mail.app -- this will "archive" the message in Gmail rather than moving it to the trash. The trouble with this is that emails that you move to a folder in Mail.app probably won't show up in your Mail.app inbox until you refresh it, so it may take a few steps to move and archive a message. Unfortunately, Gmail behaves so differently from normal mail services that using it with a standard IMAP client tends to be a pain. However, the reference in the link above should help you figure out which actions in Mail.app correspond to various Gmail actions.