Telling your son not to “be such a girl” lets his sister who overhears the conversation know that being a girl is not a good thing and she should be sorry and ashamed of herself.
It also reminds your son that being a boy is better than being a girl and therefore he is better than any girl he will ever meet.
Also if said son actually turns out to be a daughter it tells her that being what she is is so bad that she should hide it from everyone.
When I was in first grade, the other boys would tell me I threw a football “like such a girl.” And all I thought was, But I AM a girl??? Their words affected me though because I asked my mom to buy me the boy’s uniform. I continued to play with the guys during recess until I became stronger than them. I spurned my “girly” toys and dolls and threw a fit whenever my mom suggested that I should be more feminine. But whenever I had free time to myself, I remembered that when I grow up, I would be a woman. I hated myself because of my gender. When I had my first period, I was so angry. The shame in being a girl almost made me cry when I told my mom, and through the self-hatred, I screamed at her, “IT’LL GO AWAY. I DIDN’T WANT TO BE A GIRL IN THE FIRST PLACE.” I isolated myself in my room and burst into tears after that because I still wanted to be a girl deep down inside, but I thought it was proof that I would forever be inferior.
It took me over ten years to come to terms with the fact that there is nothing wrong with being female. It was a huge internal struggle with me arguing with myself, and It’s still sometimes difficult for me to wear “girly” things since I’ve been averse to them for so long. But now that I’ve overcome this obstacle, I don’t give a flying fuck what other people think. I will wear whatever I want and act however I want, and nobody has the right to make me feel like I’m second class.