There are many who question how God could be so judgmental in the Old Testament and in the New Testament loving.
I've heard many times in order to know evil you must see good. A precedent has to be made, a foundation laid. God did that. Life in the beginning was good, peaceful, the way it was meant to be, free from labor, hardship, tears, sorrow. If Adam and Eve obeyed His command not to touch one particular tree, the life they first lived would be like that. One tree. But once we are told not to do, not to touch, not to taste, not to peek, aren't we tempted all the more to do it?!
God loved His creation but when sin entered into His plan He could have nothing to do with it because of His holiness. This is a concept we must understand...He IS holy....He is good. He always has our best interest in mind, but He also judges. We cannot enter into His presence, nor eternal life, without His help...through Jesus' gift of salvation. His desire is for us to seek His Son and receive that good life back, and as is proclaimed to all who receive His Son, in the end: ..."God will wipe away every tear from their eyes; there shall be no more death, nor sorrow, nor crying. There shall be no more pain, for the former things have passed away.” (Revelation 21:4) Sounds like what it was like "in the beginning."
There was only one command when God created all things...it was directed to Adam and Eve in the verses above. Wonder where we got our pride? From thinking we could be as smart as God and falling for the lies of an evil serpent, a.k.a., the devil. So God had to switch gears, in time laying down more laws (commandments). He ushered those two, His created beings, out of a perfect world and ushered in His right to judge.
We are shown that if we disobey we will die...unless another requirement from the New Testament is met:
The next day John saw Jesus coming toward him, and said, “Behold! The Lamb of God who takes away the sin of the world!"
Jesus answered and said to him, “Most assuredly, I say to you, unless one is born again, he cannot see the kingdom of God.”
...that whoever believes in Him should not perish but have eternal life. For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life.
Therefore, if anyone is in Christ, he is a new creation; old things have passed away; behold, all things have become new. (John 1:29, John 3:3, John 3:15-16, 2Corinthians 5:17)
Old things will pass away. All things are new. New creatures, born again. God laid the good foundation in the Old Testament, it was transgressed. God showed His intolerance for disobedience. Later, after many years and examples of what God would do for those who were obedient and those who were not (blessings and curses), and in the New Testament He brought His Son, Himself, down from the throne and into the world to show Himself to the lost, to restore back to those who believed in Jesus, the good that was lost to evil sin.
Sin and disobedience has only escalated through time and has nearly gotten to the worst it can be, but not quite yet. It will get worse still. A sign that time is approaching quickly for the return of Christ. Each of us is guilty, no doubt daily. But if we confess our sins (to God, not man) He will forgive us.
God of the Old Testament showed us His idea of a perfect life, the goodness He wishes upon people. He only has thoughts of good for us. When we, as a people, decided to disobey, we were given the judgment. The God of the New Testament made a way that we might be reconciled. Seek that Way.
Romans 5:20-21 - ...the law (Old Testament) entered that the offense might abound. But where sin abounded, grace (New Testament) abounded much more, so that as sin reigned in death, even so grace might reign through righteousness to eternal life through Jesus Christ our Lord.