The Old Testament represents the flesh, the natural man. Jesus said, “The flesh counts for nothing.” This is because Jesus (God, Yahweh, Yahuah of the Old Testament) is concerned about our spirit, not our flesh. Paul says that God teaches us by example, “first the natural, then the spiritual.” Jesus told Nicodemus that we “must be born again,” that we “must be born of water and the Spirit.” The “water” is the Word of God. The Spirit is the Holy Spirit. When we believe in Jesus as our Messiah, as our Father who died for our sins (The Father died for his sons; it is not that the Son died for his Father), then we receive the “earnest” or “seed” of the Holy Spirit. THEN, and only then, according to John 1:12, we receive the “the right TO BECOME children of God.”
We do not automatically become children. Everything that God did in the Old Testament that you consider evil is “type,” a “prophetic example” of what God intends for us TO BECOME in the Spirit. For example, God commanded Moses to kill the man caught picking up sticks on the Sabbath for a particular reason. That reason was not to merely punish the man for disobedience to God’s Law. It was to prophetically demonstrate the absolute importance of “entering God’s rest” according to Hebrews 3-5. Only those who enter God’s rest become “Overcomers” and therefore qualified to enter the Kingdom of God (New Jerusalem). All of the Old Testament prophesies that Old Jerusalem will be destroyed. Old Jerusalem corresponds to “the flesh.” God destroys the flesh by the sword of the Spirit which is the Word of God. The Old Testament describes all of this in earthly, physical terms. But Jesus said “my words are Spirit and they are life.” You err because you interpret the Bible according to the flesh and not according to the Spirit.