If evolution has no compassion and we have compassion, then how did we get it? If compassion is not the result of the evolutionary process, then it came from somewhere else.
Many higher animals within a social group will demonstrate compassion. It works to help better a cohesive, mutually supportive group and make it more powerful and likely to survive than if it were just a loose group of individuals.
Certain standards of compassion and accepted behavior that are in general better for the group eventually become social norms, often interpreted as morals.