It's like the female version of the Madonna–whore complex
https://en.wikipedia.org/wiki/Madonna%E2%80%93whore_complex