I'll be honest right now, I'm pretty tired of the "Madonna-Whore Complex" being trotted out as a buzzword in discussions about Lily. I don't mean this as an attack (and certainly not on that anon) because I think like any buzzword it's just been repeated to the point where people clearly do not understand what it means anymore. Which isn't anyone's fault but I just want to be clear about this.
Lily is not portrayed as a sexually untouchable or chaste character. In fact, her own sexual desires are pretty important in terms of her character, as they lead her to start dating James. The author clearly had them in mind when writing SWM, and has heavily implied as much in later interviews. Beyond that, Lily is textually perceived as an object of sexual desire by two male characters. One of whom quite obviously has sex with her lol.
I get the idea that Lily is 'untouchable' to Snape, and also it's worth considering that the narrator is literally her son who is not going to sexualise his mother lmao. But again, Lily's sexual attraction towards James is an important aspect of her character. And that sexual attraction, as well as James's, is realised, a fact which does not take away from the moral goodness of the character, nor is it judged by the narrative. Snape's possible perception of Lily as a 'pure' and 'chaste' untouchable Madonna (which I do see him as having to some extent, but that's his own fault) is not the reality of her character, nor is it meant to be.
Like I said, the 'Madonna-Whore complex' does not refer to some women being good and others being bad. It's about tying a woman's sexuality to her moral purity or lack thereof, wherein 'impure' women are sexual objects and 'pure' women are de-sexed. Writing a woman, a mother even, as a good person is not automatically setting her up as a Madonna. If Lily is the Madonna, who is the 'Whore' intended to be viewed as hypersexual to Lily's supposed chastity?
I can see the argument that Lily as a mother and wife is 'pure' (though I think in reality this has much more to do with Harry's perception of her than anything.) But there are also mothers/wives who are morally corrupt, which is sort of a big point in terms of comparing the different mothers portrayed in HP. There are criticisms that come to mind when talking about how mothers and wives are portrayed in HP, but I just don't think the Madonna-Whore complex is a wholly accurate criticism to make in this instance.
It's absolutely important to criticise HP (or any work) through a feminist lens. But it's also important to have a good understanding of the terminology you're using to do so. Imo it's easy to reach for this concept because it sounds like something bad (and it is) but is it actually applicable here? Is it specifically applicable to Lily as a character? Personally, I don't think so.
As I said, needing to view Lily as morally corrupt in order to understand her sexual attraction to James is actually much more closely aligned with the Madonna-Whore complex. It's not inherently bad to write a morally corrupt female character as a sexual being either. But tbh the idea that fans of Lily (many of whom have written pages and pages about Lily having sex or sexual desire lmfao) are reproducing the Madonna-Whore complex, simply for portraying her as a good person, is pretty ludicrous when you stop and think about it.