“”Help me in their upbringing,
their education, and my devotion toward them,
give me among them from Thyself male children,
make that a good for me,
and make them a help for me
in that which I ask from Thee!””

This is an excerpt from Sahifa Sajjadiya, His supplication for his children.

I was just reading this with the translation, and I came upon this part. I want to ask, why is it mentioned specifically that a male child be born, rather then a female. Why is any gender mentioned for that matter? Is it not sufficient to say that a pious child be given from Allah be it a girl or a boy.

The Imam is not stating that one gender is better than the other. You can ask God whatever you want in the dua. He says amongst my children grant me males. He is not asking for only males and not asking to not have girls.

Although there are numerous narrations that if a person has daughters and raises them properly, those daughters will be the reason the parents go to paradise. The prophet was a father of daughters. However, typically a father needs a son to help him with the physical labor and the duties of running the family. So the Imam is saying the dua that many people have in mind. It is in no way against women.