Address the problem that people have a proclivity to do "bad". Call it mental health, resolving trauma, spiritual practice. When people are no longer wounded and "broken" internally, they will go out and sculpt the outer shared physical world to match their improved internal state, and all will be good.
I'm not sure this is possible, but I am sure that any attempt to control human behavior externally will fail.