The answer turns out to be very interesting and possibly tied to parakeet noses...that using color for baby gender identification is (perhaps) a pretty recent development. Earlier in the twentieth century, color identification was used but it was reversed. That is, pink was used for boys and blue for girls. This was noted in several newspaper articles (1914, 1918) advising that since pink was the stronger color and better for boys whereas blue is more delicate and therefore more suitable for girls.
Historically red is the color of blood, war and masculinity. In the past red often faded to pink, but clothing was not the easy comodity it is now, so clothing was used until it wore out or no longer fit, and often passed on to others. So men wore pink. Or at least the most feasible theory goes...
on a pink dress like thing - it was their equivilent of
a onesie for ease of diaper changing.
It is also stated that the current identification didn’t become uniform until the 1950s. Nazi Germany made homosexuals wear a pink marking and this may have had something to do with the switch in gender identification color.
But it is also said that blue may be associated with boys because having a boy baby was considered associated with good luck in ancient times. So the boy baby was dressed in blue since that was the color of the sky where the gods lived and was considered a way of warding off bad luck. Same thing in Greece where blue eyes were considered to be able to turn away evil.
In ancient China, red dye was relatively cheap and plentiful whereas blue dye was much more expensive and rare. So it was considered appropriate to dress a son in blue because he would bring a dowry to the family when he married.
Of course, I think it is the observation that male parakeets noses are blue whereas the nose of the female parakeet is pink.
Snippet from page 67 from the book title 'The Color Answer Book: From the World's Leading Color Expert' by Leatrice Eiseman
The history of pink for girls and blue for boys in not altogether clear, as it springs from folklore that can change with the cultural origin. But the censensus is that in most cultures, blue is considered a protective color and since boy babies were valued more than a girl babies, they were dressed in blue. Girl, according to old European folktales sprang forth from soft unfolding pink roses. Similarly, in many cultures, the feminine role was associated with ruffles, sentiment, and nurturing, while the masculine side with earning a living in stedfast, laboring blue.