Snape: a selfish man (and tortured by his childhood and his schoolboy bullies), who did many evil things, however redeemed by his unrequited love for Lily. That he COULD love meant that he was never really as nasty as he acted, and by the end he lived out the most vital virtue in resisting evil; courage. This meant that when it came to it, in order to love Lily, he sacrificed himself for Harry. Because he loved Lily, when Voldemort killed Snape, he was not the master of the elder wand because Snapes love for Lily meant he served dumbledore. In short: complex man with many deep flaws but ultimately redeemed by his love for Lily.
Dumbledore: a brilliant and generally good man, however tempted by glory and power, which lead him to pursue dreams to the neglect of his sister. His love for his family ultimately provided the fortitude he needed to resist the blandishments of power and the evil it creates. He was on the whole a “good guy” who had personal moral failings that caused him to circumscribe his own actions in order to prevent himself falling into the trap of power.
Harry: an actual good guy. A young man who pursued idealistically the path laid out for him by dumbledore, but who grew frustrated because he felt lost and alone. He was tempted by the deathly hallows, but his love for Dobby finally closed down that obsession and he acted ultimately for the good of resisting evil.
All 3 characters were complex, however what unifies them is that their lives were marked by love, and as a result they were able to love. This is the difference between Voldemort and his nastiest death eaters (Bellatrix, Rowle, Greyback etc) that their lives were not constituted by love, and in consequence they were unable to pursue redemption.
even this summary is still unhelpfully brief. There’s a great deal to say, but in JKR world the highest virtue is love, and then the courage (which is often the courage to love). Love is what shields people from evil and directs them away from evil and to good. Desire for power and glory are the pathways to evil.