The mishna asys that a ger, mamzer and a zakein who is not fit for children is passul to be on the Sanhedrin. Rashi comments that he doesn't understand why an elderly person who is unfit for children would be unfit to pasken. R. Akiva eiger in the gilyon ha'shas points to rashi in sanhederin 36b who says that an elderly person has already forgotten the pain of raising children and is considered an "achzar" - mean. Why does Rashi not say the same peshat here? The Miloh HaRo'im suggests that in sanhedrin where we are speaking in context of capital punishment the requirement to be compassionate is understandable, but Rashi doesn't understand why that would be important in this context. However, he suggests that since this person is unfit to judge capital cases, he is unfit to be on the Sanhedrin and a p'sak that is authorized by him would not have status of a sanhedrin ha'gadol.
The Rambam in his commentary on mishna seems to have a slightly different girsa than Rashi in the mishna. Rather that the girsa of זקן שאין ראוי לבנים, the Rambam seems to have been goreis זקן שלא ראה בנים. Rashi seems to hold that even if he has children, since he is now elderly he has already forgotten what it is like to raise children. But the Rambam explains that an elderly person who never had children will have a tendency to be an "achzari" and not be compassionate because he doesn't understand the love for children. See Rashash for some discrepancies between the Rambam in the pirush hamishna and the rambam in the yad.
Both Rashi and the Rambam agree that the dayan must be trained in compassion, and one who never had children or is elderly and forgot about the care for children, will not be able to exhibit the necessary compassion. This approach seems contradictory to the concept that we find in the mishna Kesubos 84a - אין מרחמין בדין (see also tosafos baba basra 3a who asks this on rashi). Although there is a concept of והצילו העדה and the judge is obligated to be look for zechus, that is all within the confines of din. A judge is not allowed to show compassion that goes beyond the din. Why then is there a requirement to have children so that he will be trained in being compassionate?
We learn from here a very important concept. The judge is obligated to judge using din and not any form of compassion. However, human nature is such that it is impossible for a compassionate person to use din without subconsciously looking at the issue through eyes of compassion. The Torah is not given to robots. A compassionate person by nature will not rest until he explores every possibility of exonerating the person using din. The conscious decision of the judge should be din, but the judge should subconsciously be using compassion to decide the din.