From birth boys are socialised (particularly through media, so movies, TV programs, books) to view strength and aggression as positive male traits, emotions other than anger are typically viewed as a weakness and negative traits, anything perceived as a feminine trait/activity/item/clothing/behaviour is discouraged and viewed as shameful. They are more often than not the main focus of the story, women are typically side characters, who are accessories to the male characters, rather than fully developed people with their own stories (look up the Bechdel test), hence, the conditioning to be selfish.
Girls are conditioned to look after others, to help others (they are more likely to be asked to help with household tasks than boys) to be kind, to be considerate, to not be “bossy”, to not be too demanding, these are seen as more male traits and are discouraged in girls.
We are socialised in completely different ways, most of it is unconscious, and is so commonplace we don’t question it, and as such, this results in different behaviour.