Moral codes don't have to come from religion.
Religous people are often so brought up in concepts of sin, divine judgemnt, confession etc. That they often find it impossible to understand that ethical frameworks can exist outside of religion.
Yet there are many of them. Our legal system is secular, the courts have no interest in whether you go to church and the church has little interest in whether your car tax has expired.
Groups like doctors have ethical comitees which whilst sometimes having religous representation are essentially secular.
You might ask who God is responsible to? His maker perhaps?
Concepts of right and wrong spring from our human concept of empathy. Our ability to put ourselves in the position of another person or animal.
That's why "Do as you would be done by" is such a dominant theme in ethical and religious ideas.
It also is the underlying way to be happy with your own decisions after all "good and evil" is all about whether you sleep at night.
Apologies to those who've heard it before but my favorite quote is bt Steve Weinberg a Nobel prize winning physicist and athiest.
Without religion good people would do good things, bad people would do bad things, but for good people to do bad things...that takes religion