Well, that's roughly the problem of theodicy for theistic religions. How does the perfection of God, Heaven, and the supernatural domain relate to the present, imperfect world God supposedly created? Plato addressed the same problem and influenced both Judaism and Christianity.
The ideals of righteousness were visionary (possibly entheogenic), prophetic/shamanistic social critiques, so that the monotheistic religion had satirical force, as I see it. The point was to criticize all idols and imperfections, to use the chosen tribe as a model of how everyone should act or at least as a demonstration of a higher God's power and mercy (since the Jews kept surviving hardships).