I’ve seen it argued here that women have value for just existing while men are only valued for what they produce. I disagree with this as sons are valued much higher than daughters for just being born.

This comes down to legacy and the carrying on of the family name. In most cultures (yes I am aware that in some cultures mothers pass on their name to their daughters this is the exception not the rule) sons are the only ones capable of carrying on their family names while daughters can only contribute to the continuation of other family names. This creates an imbalance in the legacy potential of sons and daughters. This increased valuation of sons happens regardless of whether they will end up carrying on their family name. It has nothing to do with sons doing something the value is inherent. Parents can’t predict the future.

The extreme of this devaluation of female babies is widespread female infanticide. There is no equivalent widespread male infanticide because men are perceived as more valuable.