I doubt there is a statistical correlation between stock market performance and "avoiding doing awful things," though obviously we would need some way to quantify "avoiding doing awful things" before we can evaluate this hypothesis.
If the definition of "awful" is broad enough, I imagine most public companies will fall in the "awful" bucket, probably with the same distribution of stock performance as the whole market. If "awful" is going to mean something truly extraordinarily bad like dumping mercury into a well or whatever, I would still guess there is no correlation as I've read horrifying stories of corporate behavior at companies with unremarkable stock performance.