I had just recently added a Gmail account to Mail.app (using Gmail's POP3 support) and suddenly found that all of my newly composed e-mails were being sent, by default, from the Gmail account. After searching the web, finding and trying various hints (about dragging and dropping accounts in the Preferences window to set the default order, making changes to com.apple.mail.plist, etc.) and still not having any success, I found the very simple solution to the problem.
It turns out that Mail.app was trying to be "helpful." When composing new messages, the selected message in my Inbox had been sent to my Gmail account, so Mail.app was automatically selecting the Gmail account for any new messages created while that message was selected. As soon as I selected a message sent to a different account and composed a new message, the sending account immediately changed to reflect that. I tested this with all three accounts (two IMAP, one POP3) that I currently use with Mail.app. I found in each and every instance, Mail.app sets the sending account based on the message currently selected in the message viewer window.
Hopefully, this will help keep someone else from going crazy trying to figure out why Mail.app is doing what it is doing.
[robg adds: I thought we had documented this here before, but all I can find a reference to is that if you have a certain email account folder selected in your inbox, that will set the sending account. I couldn't find any reference to the sender also being sent when you have a given message selected within a multiple-account inbox. If someone finds the reference, please let me know, and I'll remove this duplicate.]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050111111718467