And when one of them is given the tidings of a girl, that will be born to him, his face becomes darkened, transformed like that of one [suddenly] struck by grief, and he chokes inwardly, filled with anguish: so how is it that daughters are attributed to Him, exalted be He?
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,
(By Allah, you shall certainly be questioned about (all) that you used to fabricate.) Then Allah tells us how they used to regard the angels, who are servants of the Most Merciful, as being female, and that they considered them to be Allah's daughters, and they worshipped them with Him. In all of the above, they made very serious errors. They attributed offspring to Him when He has no offspring, then they assigned Him the kind of offspring they regarded as inferior, namely daughters, which they did not even want for themselves, as He said:
(But no! It is from their falsehood that they say: "Allah has begotten.'' They are certainly liars! Has He (then) chosen daughters rather than sons What is the matter with you How do you decide) (37:151-154)
وَلَهُمْ مَّا يَشْتَهُونَ
(And for themselves, what they desire;) meaning they choose the males for themselves, rejecting the daughters that they assign to Allah. Exalted be Allah far above what they say!
(because of the evil of that whereof he has been informed. Shall he keep her with dishonor or bury her in the earth) meaning should he keep her, humiliating her, not letting her inherit from him and not taking care of her, preferring his male children over her
أَمْ يَدُسُّهُ فِى التُّرَابِ
(or bury her in the earth) meaning bury her alive, as they used to do during the days of ignorance. How could they dislike something so intensely, yet attribute it to Allah
أَلاَ سَآءَ مَا يَحْكُمُونَ
(Certainly, evil is their decision.) meaning how evil are the words they say, the way they want to share things out and the things they attribute to Him. As Allah says:
(And if one of them is informed of the news of (the birth of a girl) that which he sets forth as a parable to the Most Gracious (Allah), his face becomes dark, and he is filled with grief!) (43:17). Here, Allah says:
(For those who do not believe in the Hereafter there is an evil description,) meaning, only imperfection is to be attributed to
وَلِلَّهِ الْمَثَلُ الاٌّعْلَى
(and for Allah is the highest description) meaning He is absolutely perfect in all ways and this absolute perfection is His Alone.
وَهُوَ الْعَزِيزُ الْحَكِيمُ
(And He is the All-Mighty, the All-Wise.)
Maududi - Sayyid Abul Ala Maududi - Tafhim al-Qur'an
This attitude of contempt towards daughters has been mentioned to bring home to them the height of their folly, ignorance and impudence in regard to God. This is why they did not hesitate to assign daughters to Allah, though they themselves felt that to have daughters was a matter of disgrace for theta. Besides this, it shows that they had a very low estimation of Allah, which had resulted from their ways of shirk. So they felt nothing wrong in ascribing such foolish and absurd things to Allah Who is above such things.