When it comes to finances, women’s worst enemies might just be their parents, who might unknowingly prepare female children for financial failure.

That’s a problem because not only do women not earn as much as men, but they face harsh financial shortfalls when it comes time to retire, and these things are exacerbated by women’s longer life spans.

It starts with the way they are nurtured, said Brie Williams, the head of practice management at State Street Global Advisors.

“If we step back and look at the retirement gap in terms of environmental and social factors, think about how you act if you are with a young male or female child,” said Williams. “We tend to say ‘Goodbye, good riddance’ to the boys when it’s time for them to leave, and to cuddle and coddle girls more before sending them off. That’s conditioning their individual response for the next time they want to take a risk.”

And yet women, often anecdotally referred to as risk-averse investors, may not be that way inherently, explained Williams, noting that many of the financial industry’s assumptions about female clients may be a result of nurturing, not biology.

Williams made these comments at a panel discussion held by the National Association of State Treasurers at the organization’s Treasury Management Training Symposium earlier this month.

Also on the panel, called “Mind the Gaps,” was Massachusetts Treasurer Deborah Goldberg, who said American children in general have financial literacy issues, which is why her state financial education programs start with kindergarten age children.

“It has to start very young,” Goldberg said. “Young kids think ATM machines make money, and they don’t even see their parents paying bills, because it’s all online.”

While the session was focused on the gender retirement gap, much of the public officials’ discussion revolved around the earnings gap, where women make an estimated 70 to 80 cents to a man’s dollar.

The Massachusetts financial empowerment programs are largely directed to closing the gender wage gap, which is a contributing factor to both the retirement gap and the earnings gap.