Compassion very often requires that rationality is disregarded and even thrown away. Also ideas of compassion are often used to play the mob and destroy individual human rights. Compassion is a very dangerous emotion that leads to conflicts and wars in real life. Maybe AI and robots should be instructed to follow a Constitution instead, that would define individuals as the highest form of life and individual rights as absolute (right not tone murdered by government, right not to be imprisoned by government, right not to be robbed by government). Then criminal code could be added (authority of justice system to isolate a violent individual to protect against murder, assault, rape, robbery).
Compassion will lead to conflict, class warfare, violence. Constitution and criminal code will lead to some form of peace. Be careful with compassion, it is used to justify most vile acts on this planet.