Greater minds than mine, of which there are many, have considered the question - 'can there be a moral code without God?' - and there have been a lot of well-considered answers.
Apparently that answer is 'yes', followed by a perfectly reasonable justification. Here is one very common response:
'The truth is, morality doesn't require a belief in God. Secular morality offers a compelling alternative, grounded in reason, empathy and our shared human experience.' (Sacrilegious Discourse)
It is surely possible to build a moral code, one that informs our legal system, one that reflects the grounding elements mentioned above. It may even function well for a period of time.
But Christians (and other people of faith) will argue that without the imprimatur of God, and the sanctions that only a divine creator can employ, such a moral code, good as it is, will eventually decay into relativism. Secularists disagree. Who might be right?
My observations, subjective as they are, suggest that just such a decline into relativism is happening now and has been ongoing for a century or longer. With the decline of faith and belief in God, together with the teaching of moral codes such as the ten commandments, the idea of truth, of what constitutes right and wrong and what this means in practical liveable terms, has been muddied, challenged and undermined. It really is getting worse by the year.
The folks who postulate theories of secular morality are smart, well-educated, decent people, who are actively interested in the well-being of society. They are a tiny minority. I don't know if, outside their virtuous circle, they notice the increasing amorality of many of the citizens around them, the disregard for human life, the decline of public discourse, the normalisation of practises and ideas that are repugnant to human dignity. Do they notice the 'my truth/your truth' brigade as they play out a classic relativistic scenario?
Yes, a moral code is possible without God. It's capacity to maintain itself though, is somewhat in question. Just look around.