Consider a Pimp finds out he can londer money and find new girls by setting up a homeless shelter. Is setting up the shelter a good action?
For the record, Bill's business practices sucked, but there's no denying that he had better vision for tech than the monster of his day, IBM. Each age has its villain, each of which has been far from what the world considers to be truly evil.
The pimps homeless shelter might also be a net positive impact. It seems far more selfish.
Alternatively it may have started Gates down a different path which changed his mindset. I can't know as this is all internal. The point is some people feel the internal reasoning is just as important as the outcome.
PS: This is one of the reasons the law cares about internal reasoning not just outcomes.
We try to judge people based on their actions. Someone messes up and defends themselves with "I was only trying to help!" - "The road to hell is paved with good intentions."[0] The fact that proverb exists at all, means that our society has at least a partial inclination towards judging people on their actions, regardless of intention.
Well, if that applies in the "mean good, do bad = bad" case, then it should apply symmetrically in the "mean bad, do good = good" case.
Concretely: Bill Gates does some good. Someone says: he's only doing it to atone. So it doesn't count. --- the first part is not the problem, but the second part is. He still did good, and it still counts. Hate his character all you want, but he did good. Don't use his character to detract from his actions.
[0] There's even a Wikipedia page about it; https://en.wikipedia.org/wiki/The_road_to_hell_is_paved_with...