Not only humans have emotions. Emotions are very common between us and animals. See Sapolsky "Zebras" book for many parallels between humans and other animals. I wonder how far it goes. Likely our reptiles, insects and fish have emotions. There are alternative studies (referenced in works of Dean Radin, David Wilcock and Rupert Sheldrake) that even plants have emotions and remote empathy.
Logically, either our gods created us with similar design or we evolved with a similar trend towards having common emotions or both. My best guess is that Earth's experiment has certain parameters radically skewed and this leads to similarities between life forms. One of Pleiadian collective channelings reveals that certain frequencies used for telepathic communications are artificially jammed on Earth. This likely results in individualism and lack of telepathy in all Earth creatures. I can hypothesize that somehow this artificial individuality resulted in the observed high development of emotions and low development of logical mind in Earth creatures.
At the moment, I can not identify the link from individuality to prominence of emotions. I sense that as I continue writing, I may stumble upon it.
By design, emotions are designed or evolved to help us thinking. Emotions and thinking in concert are designed or evolved to help us to be more successful in life. Much of our evolution took place in villages and towns. The combination of our logical mind, emotions and upbringing evolved to help us survive and prosper in this environment. Much of our history humans we warring, our villages and towns were fighting with each other and protecting primitive production facilities from traveling groups of warriors. Some of life was happening in peace, especially within big empires such as Roman Empire but much of the time there were wars and crime.
Keep in mind that in these harsh conditions were caused by high separation between humans which was caused by high individual separation. People were united only into families and small communities. Every community developed a different language and used the language and appearance to tell apart their own people from strangers. Strangers were treated with suspicion and chased away.
A great movie is artistically reconstructing this kind of harsh human life "Legenda o Tile" by Alov and Naumov.
Survival in this environment was difficult. Only now the humanity has high survival rate in civilized countries. Much of human history, many of the countries had very low survival rate. Combined with high diversity it provided a ground and conditions for evolutionary selection of humans with certain qualities. What we have now it the result of this evolution and this selection. Again, this is a combination of logical thinking, emotions and culture.
Victors in wars were males who took best women and produced more offspring. It was not only one trait that survived in these harsh conditions: there were multiple traits: warriors, rulers, priests, traders, peasants, laborers, thieves, criminals, administration and few others. In India these traits were formalized and enforced to diverge into castes. Their culture considered rational to keep seaparation and specialization between castes. To these days, most, but not all, Indian scientists I meet are coming from former casts of warriors and priests. The cast system is not now officially supported in India, but its past influences are still present. In powerful states, such as Russia, Chinese and Nazi Germany, there were waves of certain genocidal "cleanings": people with certain qualities were eliminated, that is killed. Sometimes these were genocides against certain races and sometimes these were genocides against certain human qualities. The abovementioned movie "Legenda o Tile" shows a witch hunt which gets rid of honest and psychically talented people. Lev Gumilev was researching this phenomenon for much of his life. He observed that many times in the history, honest and devoted people were eliminated by negatively oriented people. These negative genocides devastate genetic makeup of humanity. Many works by Strugatsky brothers analyze these genocidal reactions: see for example "Hard to Be a God" and "The Doomed City". Therefore, the genetic selection wasn't always for best traits. It was often for mediocrity.
Next important parameter to consider is that possibly, for all of human history, humans were evolving in presence of negative ideologies coupled with being ruled by criminals. As we study ancient texts, we see that mores were typically low and rulers were typically negative.
For example, in the early Russian history, almost every ruler came to power by assassinating his father and brothers. Stalin came to power and had all his peers assassinated except Kaganovich. The phenomenon of Kaganovich who survived party "cleanings" is to be better studied. European and Asian history was similarly dark: criminals (in wider sense) were ruling it much of the time. House of Borgia is most indicative of negative rulers and mores in Europe. Compared to Russia, Europe came out of darkness earlier with renaissance and enjoyed periods of peace and civilization while being ruled by rulers who hid their negativity from masses.
So most of the time, humans were evolving in the situation where often their closest environment were trusted friends and loved family, and their distant environment were criminals, wars, negative ideology, brainwashing and negative rulers. This continues largely to this day although there are obvious positive changes. So humans evolved much of our history under negative ideology and brainwashing. What we have today is the result of coevolution of genes and culture.
Add now let's consider another factor. The emotions were developed not only in harsh conditions, not only under pressure of brainwashing, but also under frequent change of the conditions. Look at our history. There were waves of good conditions and peace followed by wars and famine. Alexander Chizhevsky studied these waves and found that they were correlated with solar activity. Astrologists also find correlations (although weak) with planetary cycles.
So emotions formed to supplement our weak and messed up logical mind to help us survive in harsh constantly changing conditions.