I read about this story years ago. The poor elephant was attracted by the yummy watermelon and apparently had a painful ulcer or other injury near her ear. Unfortunately, the trainer pounded this painful spot on the elephant when he tried to punish her for going towards the treat. This was probably agonizingly painful for the elephant, which is why she reacted the way she did.
I've read of similar things with dogs - an otherwise gentle dog attacked and bit a child. They put the dog down. Then it turned out - the child had poked a pencil deep into the dog's ear, puncturing its eardrum, something very painful. Of course the dog bit!
I hate that animals face death simply for protecting themselves from intolerable cruelty. It's not fair.