Person A is purely selfish, while Person B is purely unselfish. Through the course of their interaction, what naturally develops is a purely exploitative relationship, with Person B offering value and receiving none in return. In an evolutionary sense, the "humanitarian" behavior of Person B is tantamount to suicide, and thus would be bred out of existence.
So why do humans have the altruistic desire to share and cooperate? Because we evolved to be social animals, to live in groups, and cooperation within a group will aid the survival of the group.
So let's imagine another scenario. Group A is cooperative within their own group, but behave selfishly toward all others. Group B is cooperative to everyone regardless of group. Once again, what naturally develops is a purely exploitative, parasitic relationship, with Group A draining away resources from Group B while giving none in return. In an evolutionary sense, the "egalitarian" behavior of Group B is tantamount to suicide, and thus would be bred out of existence.
The strategy of Group A is clearly preferable from a survival standpoint, and thus humans evolved over tens of thousands of years to behave in this way, which we can call "ethnocentric cooperation." Like all primates, we evolved to live in tight-knit tribes and to avoid or oppose all outside tribes. This is the source of all nativism, collectivism, ethnocentrism, ie. what is commonly referred to as "racism" or "hate" in Western nations. The evolutionary purpose of ethnocentrism is to protect the group from exploitation, violence, and disease.
From this evolutionary perspective, the purpose of a humanitarian or egalitarian moral ideology is to act as an auto-immune disease to weaken the natural and protective ethnocentric impulses of a host group, rendering them vulnerable to exploitation, violence, and eventual extinction. Any people with purely egalitarian attitudes will eventually be bred out of existence so long as they are surrounded by groups which retain their ethnocentric ideals.
This is the current state of affairs in most Western nations, which are experiencing a profound psychic conflict between a conditioned moral philosophy on the one hand, and basic survival on the other. This is the fundamental modern political distinction, defined by the Left focused on conditioned moral ideals (eg. multiculturalism) and the Right focused on basic existential threats (eg. radical Islam).