But when she delivered her, she said, "My Lord, I have delivered a female." And Allāh was most knowing of what she delivered, and the male is not like the female. "And I have named her Mary, and I seek refuge for her in You and [for] her descendants from Satan, the expelled [from the mercy of Allāh]."
The wife of `Imran mentioned here is the mother of Maryam, and her name is Hannah bint Faqudh. Muhammad bin Ishaq mentioned that Hannah could not have children and that one day, she saw a bird feeding its chick. She wished she could have children and supplicated to Allah to grant her offspring. Allah accepted her supplication, and when her husband slept with her, she became pregnant. She vowed to make her child concentrate on worship and serving Bayt Al-Maqdis (the Masjid in Jerusalem), when she became aware that she was pregnant. She said,
In the religious code of earlier prophets, there was a method of worship through which a child, out of one's children, could be freed from all worldly services and devoted exclusively for Allah. Following this practice, the mother of Sayyidah Maryam made a vow during her pregnancy that she would let the newborn serve بیت المقدس Baitul-Maqdis in the way of Allah and that she would not put the child on worldly chores. Sayyidah Maryam's mother thought that she will deliver a male child. But, when she delivered a girl, she was full of remorse thinking that a girl would not be able to do this duty. But Allah Almighty, out of His consideration for the sincerity of Sayyidah Maryam's mother, accepted that very girl and thereby made her status distinct from any other girl of the world.
From here we learn that a mother holds a certain measure of guardianship over her child in respect of his or her education and training, for Sayyidah Maryam's mother would have never vowed if the mother had no right of guardianship over her child. Similarly, it proves that a mother too has the right to give a name to her child. (a1-Jassas)
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 32–43
It is a psychological reality that one who loves someone cannot at the same time love the enemy of the beloved. It is also a fact that when the beloved is a Being who has the status of one’s Creator and Sustainer, then this love will necessarily bring about in the lover the desire to obey that Being in all matters. If the love of God does not produce in him feelings of obeisance to Him, then such a love is false. A believer who is one in name only will be included among the deniers. God Himself has testified to the Prophet’s total obedience to Him in all matters. So the authentic example of a life of God-worship in this world is only such as was handed down to us by His messenger.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.