I just lived through the original problem of e-mails going out on the wrong account, but in my case I went from everything working right to having the send-from problem, to resolving it. Here are my observations in the hopes that someone else will be able to solve their issues. I'm using 10.8.
Hint: When composing e-mail, next to your send-from-this-account drop down, if you also see a drop down to choose the SMTP server, then this is sign of the problem I describe below.
I have 5 e-mail accounts setup, 4 gmail based and 1 exchange. The gmail ones include a biz google apps domain (i.e. not gmail.com) while the other 3 or standard user@gmail.com addresses. As I mentioned, originally I could choose to send from a specific account and it worked. Then about 2 weeks ago, the behavior suddenly changed. I started noticing that next to the send-from drop down was a second drop down where I could choose which SMTP server to use (from a list of 5 different ones). But it wasn't there all the time. Turns out it was there if one specfic account was used.
Since multiple accounts were gmail accounts, the SMTP drop down listed "Gmail" for multiple ones with no way to differentiate which was tied to which gmail account. Obviously if you choose one smtp server, it will use the account credentials that go with it, i.e. this overrides the account-to-send-from drop down. To the user, this is subtle and unexpected. This was crucial to the unintended behavior though. Also, one of the "Gmail" smtp servers was listed differently as "Gmail (offline)" even though I was receiving e-mail fine which meant it was "online" from my perspective during those 2 weeks. Obviously the "offline" was just describing access to the out going SMTP side of things.
As it turns out the password for the mail app had been blanked for that one account unexpectedly. It also turns out that that specific account was the same one I was trying to send from all the time, aka my default sending account. So for 2 weeks I thought I was sending e-mail from my personal account but it was going out from an alternate email account. It was only when people replied to those e-mails that it became apparent something was wrong.
Looking at the account settings, the other 4 accounts, all have a check box enabled which essentially says when sending from this e-mail account use just this account's SMTP server (instead of giving you a choice from your other accounts/SMTPs servers). Of course, the 5th problmatic "offline" account did not have this box checked. Because that box was not checked, when I was composing an e-mail from that account, I would be presented with that additional drop down to select the SMTP server. There were no warning or error messages.
Fixing my password on that primary account and checking/enabling that box fixed all of the misbehavior and restored it to what it was originally when I chose which account to send from. And with all 5 accounts now in good shape and limited to using their own server, that SMTP drop-down disappeared.
Ok, so to tie this back to the original post of why isn't the mail app sending from the account I tell it to: In my observation it was this corner case of telling it to use an account for which it could not send from the SMTP server (password lost/corrupted, bad port #, etc.). Instead of the mail app giving an error message to the user, it automatically tried the next account it found, and since that succeeded, it sent the e-mail from there, i.e. not what I told it in the compose window. In other words, the app chose not to tell the user it had an issue and instead found a work around without notifying the user what it did. To the user, it looks like the compose window drop down account selector wasn't working, but it couldn't work given there was a SMTP login issue for that selected account. At least not in my case.
So now all 5 accounts are set to send using only their SMTP server and that account's login credentials. The credentials are reverified to all be working again. The drop down box to choose SMTP server is no longer showing up, and e-mails are no longer getting sent from the unintneded accounts. The send-from drop down box appears to be working normally again.
Is this a bug in the mail app? Although I commend Apple for trying to find a way to send an e-mail from any other account when the chosen account isn't work, I think it is a bug in that the user isn't notified of the underlying issue. The user said to do one specific thing and the mail app did another thing without sufficient notification. The choose-an-SMTP-server drop down, in hinesight, hinted at a problem, but less savvy users see the e-mail go out anyway, so why would they think something was wrong without an error message?