After the Plague of locusts, Pharaoh relented to let some of the Jewish people go. He asked Moshe who would be leaving.
Moshe responded בנערינו ובזקנינו נלך בבנינו ובבנותנו “we will go with our young and our old, with our sons and our daughters.”
Pharaoh responded that he would only allow the (adult) men to go, saying that for worshipping Hashem in the desert, children were not usually required.
At Matan Torah, it was essential that every Jew be present; males and females, young and old.
The Rambam alludes to the fact that the Hakhel gathering was like recreating Maamad Har Sinai, with the king serving as Hashem’s Shaliach to read the words of the Torah.
This is why Hakhel, like Yetzias Mitzrayim and the Giving of the Torah, had to be a gathering of the entire Jewish people; men, women and young children—sons and daughters.
So too in the final redemption, we will go out בנערינו ובזקנינו נלך בבנינו ובבנותנו