For those who do not believe in the Hereafter is the description [i.e., an attribute] of evil; and for Allāh is the highest attribute. And He is Exalted in Might, the Wise.
Among the Behavior of the Idolators was vowing to Things that Allah had provided for Them to their gods
Allah tells us about some of the heinous deeds of those who used to perform baseless worship of other gods besides Him, such as idols and statues, with no grounds for doing so. They gave their idols a share of that which Allah had provided for them,
(They say: "This is for Allah," according to their claim, "and this is for our partners." But the share of their "partners" is not directed to Allah, while the share of Allah is directed to their "partners"! How evil is that with which they judge) (6:136) That is they assigned a share for their idols as well as Allah, but they gave preference to their gods over Him, so Allah swore by His Almighty Self to question them about these lies and fabrications. He will most certainly call them to account for it and give them the unrelenting punishment in the fire of Hell. So He says,
Also at the end of the third verse (60), in: وَهُوَ الْعَزِيزُ الْحَكِيمُ (And He is the Mighty, the Wise), there is a hint that taking the birth of a baby girl to be nuisance and disgrace, and hiding from people because of it, amount to challenging Divine wisdom - as the creation of male and female among the created is the very requisite of wisdom. (Ruh a1-Bayan)
Ruling:
Clear indications are visible in these verses that taking the birth of a girl in the family to be a disaster or disgrace is not permissible under Islam. This is done by disbelievers. Quoting Shr'ah (شرعہ ) Tafsir Ruh al-Bayan also says that a Muslim should be happier at the birth of a girl in the family so that it becomes a refutation of the act of the people of Ja-hiliyyah. Says a Hadith: Blessed is the woman who gives birth to a girl in her first pregnancy. That the Arabic word: اِنَاث (inath: females) has been made to precede the word for 'males' in the verse of the Qur’ an: وَيَهَبُ لِمَن يَشَاءُ الذُّكُورَ (He bestows on whomsoever He wills females and bestows on whomsoever He wills males - 42:49) indicates that the birth of a girl from the first pregnancy is better.[
In another Hadith, it is said: Whoever finds any of such girls en-trusted to his care, and he treats them fairly and favourably, then, these girls will stand as a curtain between him and Hell. (Ruh al-Bayan)
To sum up, it can be said that taking the birth of a girl to be bad is a detestable custom of the pagan period. Muslims must abstain from it. In fact, they should be pleased and satisfied with the promise of Allah against it. Allah knows best.
Tazkirul Quran
Maulana Wahiduddin Khan
Why does a man want children? It is for the purpose of compensating for his shortcomings. But God is above such things. The Majesty and Power of God, which is evident in the existence of the universe, shows that God is far above any shortcomings to compensate which He would feel the necessity of creating a son or a daughter. The fact is that if God were deficient in any way, He would not have been God at all. God is God because He is entirely flawless.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.