The Maharil (Milah 1:p.65) writes
נראה בעיני הטעם משום דאי׳ בגמרא אמרו לו אשתו ילדה זכר מברך הטוב והמטיב וי״מ משום ארבעה צריכין להודות ואחד מהם היוצא מבית האסורים וכן התינוק יצא כן מאסורי מעי אמו - The Gemara says a woman who gives birth to a son says Hatov V'Hameitiv, and there are commentators who explain this is because it is simlar to the four who must praise Hashem for being saved, including one who emerged from prison, as this baby emerged from the prison of his mother's womb.
Seemingly according to this understanding, why shouldn't we say Hatov V'hameitiv for a daughter as well, rather than shehechiyanu as mentioned by the Mishna Berura 223:2 and others.