From The Straight Dope: Was pink originally the color for boys and blue for girls? by Cecil Adams
In the 1800s most infants were dressed in white, and gender differences weren't highlighted until well after the kids were able to walk. Both boys and girls wore dresses or short skirts until age five or six. Differences in clothing were subtle: boys’ dresses buttoned up the front, for example, while girls’ buttoned up the back. Why no attempt to discriminate further? One theory is that distinguishing boys from girls was less important than distinguishing kids from adults. Childhood was a time of innocence, whereas adulthood typically meant grueling physical labor. Perhaps mothers decking out their little boys in dresses thought: They’ll get to be manly soon enough.
By midcentury baby clothing in colors other than white had begun to appear, but gender-based distinctions were slow to emerge. In 1855 the New York Times reported on a "baby show" put on by P.T. Barnum, exhibiting "one hundred and odd babies" dressed in pinks, blues, and other colors seemingly without regard to gender. In a passage from Louisa May Alcott's 1868-'69 blockbuster Little Women, a female twin is distinguished by a pink ribbon and a male twin by a blue one, but this is referred to as "French fashion," suggesting it wasn't the rule over here. A Times fashion report from 1880 has boys and girls dressed alike in white, pink, blue, or violet, and another from 1892 says young girls were wearing a variety of colors that spring, including several shades of blue.
But from the 1890s onward, boys' and girls' clothing styles started to diverge, with boys dressed in trousers or knickers at progressively earlier ages. Jo Paoletti of the University of Maryland, a longtime specialist on the topic, reviewed more than 500 descriptions and images of children's clothing appearing in print between 1890 and 1920 and notes a rapid "masculinization" of boys' wear, for reasons that remain obscure.
As part of this differentiation, there seems to have been an effort to establish characteristic colors for girls and boys. But it took decades to develop a consensus on what those colors were. For years one camp claimed pink was the boys' color and blue the girls'. A 1905 Times article said so, and Parents magazine was still saying it as late as 1939. Why pink for boys? Some argued that pink was a close relative of red, which was seen as a fiery, manly color. Others traced the association of blue with girls to the frequent depiction of the Virgin Mary in blue.
I’m not convinced, however, that there was ever a consensus that pink was for boys and blue was for girls. On the contrary, indications are the two colors were used interchangeably until World War II. Examples of pink as a mark of the feminine aren't hard to come by, one of the cruder being the use of a pink triangle to identify homosexuals in Nazi prison camps. After the war the tide shifted permanently in favor of blue as a boy's color. In 1948, royal-watchers reported Princess Elizabeth was obviously expecting a boy, since a temporary nursery set up in Buckingham Palace was gaily trimmed with blue satin bows. By 1959 the infantwear buyer for one department store was telling the Times, "A mother will allow her girl to wear blue, but daddy will never permit his son to wear pink."
How did pink get ghettoized as a girls' color? Nobody really knows. Professor Paoletti thinks the choice was largely arbitrary, but others credit innate biological tendencies. Research on color preference in monkeys has shown females prefer warmer colors like pink and red — supposedly an infant primate's pink face brings out its mother's nurturing instincts. A color preference study of Caucasian and Chinese men and women showed both Caucasian and Chinese women strongly preferred red and pink, while Caucasian men strongly preferred blue and green. However, the Chinese men showed a broader range, with many picking red and pink — possibly because in China red is considered lucky. To me that suggests the biology argument is pretty weak. Sure, my favorite color is blue. But it's entirely possible I say that because I was always told I should.