I don’t have specific answers for those things, but I have an idea about why such things exist in the Old Testament. After all, among the laws in Deuteronomy and Leviticus are very harsh, extreme penalties, and there is the story of Uzzah who, apparently trying to prevent the Ark from falling when the oxen stumbled touched the Ark. He was killed immediately.
The idea I have comes both from Jesus’ teachings and from Nature. Jesus said, “Be perfect, therefore, as your heavenly Father in heaven is perfect.” And in his teachings he gave some examples of what this means, such as concerning adultery, regarding enemies and giving up possessions.
In Nature, when an ecosystem has become fully developed and mature, each member of it plays a role. Each member’s offspring enter the environment in a manner that protects them from it, although how much so varies considerably. Generally, some produce few offspring at once and the offspring are highly protected, while others produce many with little protection, and only a few of the many survive to maturity. The ones who survive, though, must become perfect examples of their type in order to survive. This is how God set up the material world.
Humans are different from all other creatures in that we have the capacities (at least in potential form) both to adapt to our environment and to adapt our environment to us. Other creatures can do the latter to a very limited extent (such as beavers), but they lack the combination of cognitive and physical abilities that make us as capable of it as we have demonstrated. I think one can view the story of man’s creation on one level as an assertion of this dual capacity. God gave us dominion of the Earth and all its creatures, but he also gave us guidelines to which we were to conform. The bulk of the Old Testament is about our failure to conform to those guidelines and the resulting consequences for us.
Yet, the fundamental concern of the Bible is with our hearts. I think we can use natural ecosystems as an analogy for the nature of our hearts. It’s members are not creatures, of course, but desires (or treasures) and fears. “Where your treasure is, there your heart will be also.” “And do not fear those who kill the body but cannot kill the soul. Rather fear him who can destroy both soul and body and in hell.”
The strictness and harshness of the Biblical laws and of events such as those you are citing, I think, are calling us to learn what perfection is (not so much or merely correct behavior, as a well-balanced and mature ecosystem of desires and fears), and also vividly and pointedly demonstrating that the difference between perfect and imperfect is life and death. Just as it is in a mature ecosystem for all members of it (consider the Sword Billed Hummingbird!). The Old Testament is also demonstrating that the consequences of what we do go on and on and on, affecting the doer in the afterlife, and affecting those who come after for generations without end; and all of God’s interactions with humans in the Old Testament are also serving to contain sin, as part of the process through Jesus can come and fulfill his role, and through which our reunification with God in Heaven can happen. That we should respond to reading of such harsh happenings with incredulity or horror or confusion I think is intended. For if we are open in our hearts to God, then we will search for answers and such a search is a necessary part of our becoming perfect.
So what should we do in regards to such passages or other things in the Bible that confuse or repel or horrify us? I think the answer is to continuously read the Bible, to seek to practice what we learn, to pray for help and to seek understanding, as you are doing.
Understanding an ecosystem in Nature fully is not possible until one has come to know all of its members and the relationships between them completely, within the cycle of replication and change of which they and the system itself are a part.
Ultimately, this I believe is what the Bible is here to help us do, that we might come to know our own hearts, and through that the heart of God, and through that, God, that we may live in the fruits of the spirit, untarnished by the fruits of the flesh.