Well, first of all, Anya never lost her soul. In the Buffyverse, that is only a thing that happens with vampires. A person gets turned and their soul leaves their body, then a demon comes in and takes control of everything while keeping some of the personality of the human it now embodies.
Next, as others have said in here, Anya is not particularly crippled with guilt because most of what she did she believed was justified. She was extremely vengeful toward men because of... I guess Olaf cheating on her and treating her badly? Honestly, there should have been a lot more than that for the magnitude of her resentment to be believable.
I'm not sure exactly if the moment d'Hoffryn turned her into a demon her anger was multiplied or something like that. It's possible? One thing for sure, though, is that she had centuries of experience witnessing the worst in men when it comes to how they treat women. So it would make sense that she'd be a little biased toward our whole sex. 😂
But, yea, the quick rundown is... Anya always had a soul, she felt justified in her actions, and thus did not feel much guilt at all. It's only when she became human again and got to hang around the Scoobies and saw the goodness that some men
and women could display that she began to change her mind a bit. This explains why she had a lot more trouble being a vengeful demon again in season 7. She had seen the other side of humanity. She just couldn't feel
as justified as before.
Realistic answer?
Writers were dumb, and they didn't even care about the audience and the "moral problems" like they preached. Anya was a shallow character based on bad writing, and her jokes were represented as a funny thing.
The problem wasn't only Anya, otherwise the "moral" Xander and Scoobies would have said something, and act/behave differently about her behavior and jokes. It was a problem of the show and writers in reality (not only characters).
Xander and the Scoobies didn't care about her jokes, her behavior and her soul: Why? Because of bad writing.
Logically and realistically, Anya is even more problematic than Angelus and Spike, 2 demons (the souls of Liam and William shouldn't even be considered responsible for the action of their corrective demons.) from a "moral point of view".
Also, the reason Spike (and Angel) were represented in toxic/abusive relationships is that they were hot. Joss and other writers were frustrated that girls loved them.
Angel and Spike were never supposed to be main characters, Joss and writers decided to make them main characters only because of audience (and money). Spike and Angel should have been characters like Parker in order to teach morality to girls (in high school and college) because of Joss own problems with girls:
-Angel/Angelus and Parker with Buffy: "I'm a good guy until I get in her pants"
-Spike with Harmony/Buffy=Toxic abusive boyfriend
In reality, Joss' logic: It is ok for him to want to f..k hot girls, but it isn't ok for girls to want to f...k hot boys (because they have to sleep with him).
However, he covered his real desire and problems under a facade of "feminism" 🤣 (this was also the origin of the Joss' scandal: his behavior and his successive pathetic justifications).
It was all fake/inconsistent morality from the show and Joss/writers.
Although I don't fully disagree with everything you're saying here, this sounds a little too much like you're inserting your personal agenda against Joss to explain away the entire character of Anya... and Spike... and Angel. I think it's a little more complicated than that.