The question of the logic of emotions often comes up when a person enters psychotherapy for the first time. Stereotypically this is true of male engineers more than others, but it comes up with many people. The question has two parts.
The first part of the question is about the logic of experiencing a particular emotion in a particular circumstance. A person who is feeling frightened in a situation that appears to be safe will sometimes attempt to dismiss this emotion on the grounds that it is not logical to feel it under the circumstances.
The second part of the question has to do with instrumentality. It asks why one should even attempt to experience or communicate emotions, since they do not accomplish anything.
Therapists often respond to the first part of the question by pointing out that emotions are inherently non-logical and originate primarily in the unconscious. Therefore there is no point in trying to make them congruent with the current circumstances in the external world since they are driven primarily by unconscious factors in the internal world.
The part of the question of logic and emotions that has to do with instrumentality is a bit more intricate. The answer has to do with time, among other things. In general it can be said that there is value in experiencing one's emotions because it allows one to know more about who one is and therefore to possibly live more authentically.
However the ideas and events associated with emotions have different significance depending on time. Emotions attached to things in the past can sometimes bring to awareness old wounds in need of healing. Sometimes, particularly with guilt, one is given the opportunity to make restitution. Emotions having to do with the present are much more directly involved with identity––knowing who one is. They are also most directly involved with connection with other people, since sharing emotions with others in the present often brings about a profound sense of connection. Emotions attached to the future can help guide one's life toward maximum satisfaction. This can occur in both a negative way and a positive way. If imagining a certain course of action in the future stirs up feelings of pain or regret, this can be valuable information in terms of how one does not want to live one's life. Conversely, when imagining things in the future that bring up feelings of happiness and fulfillment, one learns something about how one perhaps does indeed want to live one's life.
Perhaps the mother of all emotions is mystical rapture, the state in which one feels connected by infinite love to all other beings. Allowing oneself to experience such a feeling state can heal wounds from the past, clarify one's identity in the present (I am a part of the whole) and guide one's actions in the future (I do not want to harm others because I am intrinsically connected with them). Mystical rapture sometimes occurs very profoundly and suddenly in what Maslow called “peak experiences.” These can occur spontaneously or as the result of intentionally seeking them through the use of entheogens or any of a number of other spiritual practices. It appears to me that mystical rapture can also occur incrementally and cumulatively as a result of ongoing regular spiritual practices, such as mindfulness meditation.