Pre-industrial Europe had a tradition that required women (defined as females who had lost their virginity) to protect their surroundings from the supernatural potency of their hair. Part of the iconography of Mary, the mother of Jesus, was that she was the only mother in history who could wear her hair unbounded (although many times she too yielded to convention with bound hair); because she was a virgin, her hair hadn't gained the supernatural potency that resulted from the sexual act. By showing the young mother with a child on her hip and hair flowing down unbound, the artist was communicating a great deal of theology to an audience who would understand the message.
The following is an excerpt related to this from my e-published Introduction to Folklore:
Young women were strictly regulated by older women who took care to limit their promiscuity. After losing one’s virginity, a woman’s hair gained supernatural potency that could affect crops. The hair of women should be bound, consequently, especially when near farmland or entering a church. Aprons were also designed to protect food while being prepared, and this garment needed to be worn when attending church since the pubic region of a woman carried with it a particular degree of supernatural potential. By regularly inspecting adolescent girls, groups of older women in a village could publically declare the loss of virginity by forcing a young woman to suddenly take on the scarf and apron, leaving little question that the adolescent in question was no longer a virgin. The possibility of this public shaming inhibited pre-martial sexual activity.
Can you please provide images of women in headscarves you are referring to (possibly with source you get them from)?