It is reason, logic and rationality that machines, said to be soulless, have. In the deontological sense, in fact, morality is evolutionary atavism. It let us survive, that's why it was maintained. As parents were not empathetic, not guided by the good of others, children might have not survived, neglected and abandoned by the group, so morality was promoted in the genes.