This is completely normal at age 4.
Apparently, they have to go through the black and white, dividing everything into discrete categories phase before they can move past it into seeing shades of grey. It's not only gender, but we do notice it very clearly with gender roles.
There was an interesting bit in Delusions of Gender about age 4 - the way the author put it there is that children of this age are basically in a developmental stage where they are working out what makes people "us" and what makes people "them" - and if you look at the world which surrounds them at that age, we refer to gender ALL THE TIME. It's not "Good morning Sunshine Class" it's "Good morning girls and boys". It's not "Can you three tidy up please and join us on the carpet?" it's "Can you girls tidy up please..." it's not "Thank you for helping me" it's "Good girl for helping me". Lots of products are marketed strictly along gendered lines.
In addition, we consciously avoid (for good reason) dividing people by other measures such as race, nationality, origin, ability, interest, size etc. The only other one that we make very important to children is age. So when they are there looking for what group they fall into which the other children don't, they centre on age and sex.
In order to try and combat this with my first DS I was really conscious to NOT use the term "boys, come and..." and I stopped using "Good boy" and changed to "Thank you for..." or "That was very (helpful) of you!" I tried to use our family name as an identifier rather than talking about "Big/brave/strong boys do XYZ" - and I've since learned that telling children about their family history and helping them feel part of something in the way of involvement in a family can be extremely beneficial in many ways. This can help children have an anchor of "I'm a Botts!" rather than "I'm a girl and girls are better than boys because XYZ" (or arguably worse) "I'm a girl, but I wish I was a boy because boys can XYZ"
But, he definitely did the boys/girls thing anyway. We had lots of conversations when he was 5/6/7 about how "Some people think all girls X and all boys Y but that's silly isn't it? What about this girl who likes Y and that boy who likes X?"
I think in hindsight if I had known it was just a phase they have to necessarily go through to get to the other side where they see all the exceptions and then the vast area of grey in the middle, I might not have worried about it so much.