I'm not saying be hostile. Granting advancement to somebody who exposed weakness over someone who didn't, if all other things are equal, would be even more of an act of hostility. That's not fair to the other person at all.
And I'm not saying don't expose vulnerability. It's just, work isn't for that. We should all talk to friends and family about that (and I'm sure most of us do).
You see this as an imposition on the people exposing their vulnerability, but demanding that managers suspend reason and ignore relevant data in their decision making is an imposition on them, and it's also just a bad way to run a company.
Indeed, exposing vulnerabilities (of the personal kind, not the security kind) can be imposing in a very inappropriate way.
Your colleague is not obliged to be your free therapist. Don't impose emotional labour on them if their body language or response indicates they don't want to be having this conversation. You don't know what issues they are dealing with, which may be much worse than your own. Talk to a friend or family member, or pay for a therapist.
Thoughts I'd have if I heard that:
1) So when we asked her why she wanted to work here and she told us she would find the work interesting, she was lying?
2) Is her current work any good? It can't be if she's demotivated.
3) If I invite her to a business meeting, is she going to say something similarly thoughtless? Maybe she blurts out that she thinks the customer's request is stupid, or something similar? Seeing as she just said in front of her manager that she regrets her entire career choice, which should have been just an obviously bad idea, can I trust her basic judgement in other areas?
4) Apropos 3, if she shows such a lack of social awareness surely keeping her away from the business side and in front of a computer is for the best.
This is like shaking your fist at gravity.
Everyone's in competition all the time whether they like it or not, that's the universe we live in. Given a choice, you're going to advance the person who's glad they got into computer science, all things being equal.
Even worse than regretting her degree in computer science is the poor judgment she displayed by saying that in front of a manager. The statement is clearly not in her own best interest, it's fairly obvious, and she completely failed to recognize that.
It's not a huge deal by any means, but objectively, it's a negative indication. Why should managers ignore that? Those are relevant data points she just revealed.