At the same time he should realize that if she gets pregnant anyway, he has to pay, legally and morally. There is no moral or legal way around this, sexual harrassment or not. A man should never have sex with a woman unless he knows and accepts this particular fact of life.
If all things were equal, it could be deemed to be “not fair.” but there are a lot of things in life that are not fair. It’s the way our society works that a father has to be sure his progeny are taken care of—even if—and especially if, he thinks he should be off the hook if he can claim she tricked him. There is an innocent child to consider, and that takes precedence in our society.
The child can be disposed of in one way or another.
An example of this is that many young men in my generation don’t take responsibility for fatherhood; often the girl’s parents will take responsibility financially, and the girl will just date whatever guy will put up with her having had a baby. The father might have enough contact with his scion to be considered a worthless relative, but I guess if the girl doesn’t care, then most guys won’t be bothered.
Basically, the attitudes towards family and responsibility that you’ve described are dying out.