Sometimes there are mail accounts OS X's mail app that won't delete. This is usually you have multiple accounts with the same provider. In reality its simply that there is a lock on them. There is a simple fix.
- Go to system preferences
- Open iCloud
- Untick iCloud keychain
- Go back and retry
- Finally reverse these steps to turn it back on