However it wasn't an universal moral code.
Well morality is more up to the individual. You can't make laws forcing people to be moral. You can make laws that punish people for doing evil things like theft, murder, etc. But you can't reallt force or make laws telling a person to be moral like say donating to the poor or giving up your seat to a senior. That's where, imo, religion comes in. Religion, or atleat most religions, teach morality but even then people are expected to do wrong which is fine as long as they realize their immorality and seek to correct it. The only scripture that really teaches it's followers how to act in day to day life and how to be moral is the Talmud as it covers everything from food, child birth and rearing, clothing even how to invest your money. Koran is similar but not nearly as comprehensive.
people are neither good nor bad, they have potential to be either good or bad or bot
I disagree. I think all people are intrinsically good or bad. Bad people can do good things and good people can do bad things. But still people lean a certain way. For example let's say a person finds a wallet on their groubd. Their instinct may be - free money, it's mg lucky day or they may think poor person, they lost their cash ad their cards that really sucks I'll try to help them out. Now their morality may kick in or it may not. The person who thinks free money may decide nah that's an ******* move and attempt to find the owner while the person who thinks poor person I'll help them may end up deciding well I have an upcoming bill to pay, I'll keep the money.
About different civilizations that install and hold dear different values.
Of course. But nonetheless most civilizations instill similar values and morality, some of which may cone from religion as oftentimes civilization, national identity and religion go hand in hand. Whether a Tibetan Buddhist from the 1500s, a modern day Christian from spain, or an 8th century Muslim from Saudi they're all taught the same basics like honor your father and mother, don't kill, don't steal, etc. But they may differ on other things like Muslims and Jews believe charging interest to people of the same faith is sinful and wrong, while in christianity that isn't really taught or discussed.
And you're right Hammurabi was Babylonian not Egyptian.