1 – The Prophet commanded justice, and a command implies that it is obligatory.
2 – He explained that showing preference to one child or singling him out to the exclusion of the others is falsehood and injustice, in addition to his refusal to bear witness to it and his commanding him to take back his gift. All of that indicates that differentiating between one’s children is haraam.
They also referred to the evidence of common sense:
Ibn Hajar mentioned in Fath al-Baari (5/214):
Among the evidence of those who say that it is obligatory to treat one’s children equally is the fact that this (differentiating between children) is the first step that may lead to something haraam, because cutting off family ties and disobeying one’s parents are two things which are haraam, so that which leads to them may also be haraam, and differentiating between one’s children is something that may lead to them.
This is supported by something which was mentioned in a version narrated by Muslim (1623): “He [the Prophet (peace and blessings of Allaah be upon him)] said, ‘Ask someone else to bear witness to this.’ Then he said: ‘Would you like your children to all honour you equally?’ He said, ‘Of course.’ He said, ‘Then do not do this.’”
Further evidence is the fact that preferring some of them to others generates enmity and hatred between them, and also between them and their parents, so that is not allowed (al-Mughni, 5/664); this meaning is similar to that mentioned above.