All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
There is no disagreement among scholars that the discerning child who has done his ablution can pray in the first row and his prayer is valid. But they disagree regarding the appropriate place of the child in the row. Some scholars believe that the children should be behind the men and that their placement there is the prayer's best for completion. Their evidence for this is the Hadeeth reported by Muslim that the Prophet said while talking about those who should be closer to him during prayer: “Let those who are prudent and sedate be near me, then those who are next to them, then those who are next to them, and beware of the tumult of the market place.” [Muslim]
Other scholars believe that the child is like anybody else who comes first to the mosque and takes a leading place (in the first row). They think that he deserves his place more than anybody who comes after him. Their evidence for this is the generality of the rule that whoever comes first to a place he deserves it more than anybody who comes after him. They add that the mosques are the houses of Allah and all people inside them are equal.
In addition, the Prophet denied that a person should ask his brother to leave his place and then sit instead of him. Moreover, the child might hate the mosque if removed from the place where he was. He might also hate the person who did that to him.
As for what is meant in the Hadeeth, it is that those good people should hasten to the mosque to be the closest to the Imam. It does not mean putting children in the back rows.
Allah knows best.