Because God is sinless, pure and righteous and God hates sin. Nobody is comparable to His standards. The law was given to show how short we fall of God’s standards and therefore the need for a Saviour… He also knows that sin always hurts us, e.g. divorce is never pain free… somehow, somewhere, someone gets seriously hurt.