To the ungodly, man created god and it was good (at least for a time) and then sin descended and man`s god was a pitiable creature full of lust and want, envy, wrath and greed. Then god wasn`t quite so good as expected, and so man decided to kill his god and sent forth the bright atheists pointing to water from which all life emerged and a rainbow appeared from all the gay parades and low and behold... god was dead.
I don't know of anyone, believer or non, that claims to have a perfect moral code. I don't know of anyone who claims human beings aren't flawed.
After all, we're very imperfect primates with frontal lobes that are too small and adrenal glands that are too big. One would expect as much.
You just have to do the best you can.