In the first place, the notion that Jesus is more loving and gracious than YHWH is simply mistaken, and betrays a poor reading of the Old Testament. My friend Derek recently posted on Facebook a perfect rejoinder to this objection. Reading through the Psalms, one finds that the most common complaint against God is not that he judges too harshly or too strictly, but rather that he defers judgment for too long! Recently I've been reading through 1 and 2 Kings, and it gets tiresome to read of a king that he did what was evil in the sight of the LORD, just as his forefathers had done, and that he had caused the people of Israel to sin. And yet God does not destroy them but lets them live, all the while providing prophets and messengers to try to get them to turn from their evil ways!
The most vivid example of this is in 2 Kings 17.5ff., where the story of Israel's exile into Assyria is related. He puts up with generation after generation of heinous sin, including child sacrifice and rabid injustice and murder. We would not even tolerate such persons to live, but YHWH gives them chance after chance to repent. Yet the Lord warned Israel and Judah by every prophet and every seer, saying, “Turn from your evil ways and keep my commandments and my statutes, in accordance with all the law that I commanded your ancestors and that I sent to you by my servants the prophets.” They would not listen but were stubborn, as their ancestors had been, who did not believe in the Lord their God (2 Kings 17.13-4). Some of us can hardly stand being publicly disrespected and ready to go to blows over an insult, and yet God puts up with generation after generation of sacrilege and evil and wickedness, all the while reminding them of the covenant and calling them to live differently.
YHWH in the Old Testament displays a patience beyond what is humanly possible. We are not as gracious as we think we are, and YHWH is not any less patience than Jesus is. The same patience that put up with generation after generation of wickedness and injustice is the patience that puts up with adultery, and says without casting any stones, Go and sin no more (John 8.11).
Other persons object that YHWH's moral laws seem not to live up to those of Jesus. How do we compare "Eye for an eye" with "Resist not the evildoer"? The truth of the matter, however, is that God wants the perfection of humanity, and this takes time. Humanity is stubborn and doesn't want to listen, doesn't want to be taught, doesn't want to change its ways. The people of Israel and Judah as recorded in 1 and 2 Kings are an ample demonstration of the fact. God realizes that this change takes place, and he tries to educate and train us within the limits of our weakness.
For instance, a friend on Facebook recently shared this picture:
Perhaps part of the reasoning behind the joke is this: between these two, slavery is obviously (to us) the greater evil; why doesn't God disallow that one, rather than the other?
The answer to the question is this: what is obvious to us now, after two thousand years of Christianization of the West, was not and is not obvious to persons without our background. We see slavery as an obvious evil because our moral intuitions have been trained by the teachings (believe it or not) of the Old and New Testament. The dignity of the individual, the creation of every person in the image and likeness of God, the freedom of the individual to determine his or her own destiny -- these are elements of Judaeo-Christian ethics. We come to these realizations, however, because the seeds of the insights were planted in the Old and New Testament. "Love thy neighbor," as I said, comes from Leviticus.
God knows that the perfection of humanity will take time, and so he deals with us as he finds us. He plants seeds of instruction and education in the teachings he gives us, and these seeds develop and eventually blossom. Slavery could not have been abolished so easily as making laws against it for the desert-wandering Hebrews; they didn't even listen to the laws he did give which do not appear so difficult to follow (e.g., worshiping other gods, sacrificing your children, etc.). But he does give them laws about the treatment of slaves that provide them with greater dignity and respect than was found in other societies (e.g. in ancient Rome and Greece, where slaves were unconditionally sexually available to their masters).
God takes his time, and he does so because we hard of heart and hard of head. We don't listen to what he tells us, and at the same time we pretend to be justified arbiters and judges of what he does and commands. Thank God that he is patient and gracious!