Why do we need laws? Well, there are many answers to that. Here are some of mine:
Without laws there would be no civilization because people would do whatever they wanted whenever they wanted and however they wanted and ther would be no sense of community.
With laws, we stop criminals, we set boundaries and we give rights to people. A civilization cannot function if no rules are set. Also, in a civilization, people have to have some boundaries but also equal rights. If a civilization only IMPOSES on its citizens, then it would be dictatual rule and nohing else. Laws are needed to keep everything in order, to make sure things continue to happen, to ensure that the people of the civilization live. Yes, laws protect people physically too. Without laws, we could kill people for candy and nothing would happen, you could shoot your parents for not letting you go to a party. Everything would be in total disorder. Laws make civilizations what they are and it is laws that determine how well a civilization will do in the long run.
When I think of Hammurabi's code I think its very harsh. I do think he had a reason for that though. In the picture it ssays law and ORDER. Hammurabi set the punishments for not respecting the law really high so nobody would oppose his law. I think he might have also done it because otherwise, if the punishments were smaler, than I believe that there wouldn't be much order as some people could find it affordable to break the law.