There is a universal moral code.
It is found in almost all cultures, geographical locations and belief systems.
It is part of our biochemical make-up.
It is the law of reciprocity forged on our empathy and our basic surival need for social stability and cohesion.
With the exception of mentally unbalanced people (psychopaths and sociopaths) we all have an intrinsic need to make others happy, feel included, trusted and desire the same treatment.
We are biochemically rewarded with a rush of oxytocin to our brain when we make a decision that leads to someone else's happiness, health and gratitude for what we have done. When others are happy, it makes us feel happy. When others are sad, disappointed in us, treat us with suspicion, scorn we feel awful because the brain releases stress hormones like cortizol instead of the oxytocin we crave.
With that foundation, it therefore augers well for us to construct laws that promote the happiness, health, security, unity of our society while at the same time gaining trust, respect, cooperation from other societies.
Over the years we have refined our laws to better do this and that is a GOOD THING, regardless of whatever religious morality you choose to practice in your personal life.