There are feelings and there is logic. Wanting to do something generally comes from an emotional feeling wanting to be met. However the mind presents logic opposed to it. Or the situation may be in reverse. The action generally is caused from whichever is stronger at the moment.
This does not excuse behavior, it only explains it.