If you don't wanna be in the friend zone, stop being their shoulder for her woes with other guys. I don't know how any guy thinks that is gonna work.
if i put on my dr muzby hat again and we revert back to the basic human instincts which drive our behaviour, this action is driven by the perceived vulnerability of the female at this point in time.
a basic human trait is to take the path of least resistance - so when we see a potential mate that we like that is in a vulnerable state (in this instance needing emotional support) and has been left alone by the previous potential suitor, the instinct is to go in and try to claim this mate as our own.
unfortunately the reason this position rarely works out for the male is because of the female trait of seeking out the strongest possible mate.
the comforting male is showing sensitivity and compassion, two traits that are traditionally a sign of weakness* when it comes to protecting a family from attackers such as other tribes or a stray mammoth. so once repaired the female will seek out a strong and protective male who will protect her from any further pain (even if, in modern day times, this guy may do exactly the same as the last one who hurt her..)
*which leads to why nice guys finish last - evolution determines that the strongest of the species are the ones who survive.