Making something that other people are freely willing to pay for is a very good proxy for doing good.
For example, you could get paid by criminals to make ransomware or by an ad company to flood users with ads or by a cryptocurrency company for building tools that facilitate money laundering and tax evasion or by a government to create a database of dissidents and protesters or by a toy company to use ML to generate fake reviews...
I should think that running a criminal business was outside the scope of what I was talking about.
What happens when those in power decide that your views are harmful and should be suppressed?
An awful lot of evil is done in this world in the name of doing what's best for others against their will.