This is a very interesting question. One possible answer is that G-d created the world, implanted the laws of nature, and has no further interaction with His creations. With this theory there is a long and tedious explanation for this philosophical view regarding the revelation of the Torah that does not bear repeating as it goes well beyond the scope of this answer. Yet it is essential for understanding the answer. Thus, I will give a brief summary for the sake of brevity. Simply stated, Rabbi Micah Goodman says that in the first chapter of his Mishneh Torah Rambam writes that G-d does not speak. How was the Torah revealed? Moshe looked into the laws of nature (that is a divine creation) and produced the Torah. Similarly, Abraham discovered G-d by studying the heavens, natural law. Thus, the Torah is certainly holy.[1]
So whether one wants to agree or not, there is another concept that we should recognize, that the world functions according to the laws of nature that G-d has created. One of these laws is that actions have consequences, and they can have long-lasting effects even for generations. For example, King David made a sin, an adulterous relationship with Bat Sheva.
Summary
Despite the fact that people make repentance, teshuva in Hebrew, actions have consequences, (David also repented), but due to the consequences of his actions, he suffered and his punishment came later when he discovered the immense pain he caused not only for himself but countless others.
[1] See Maimonides and the Book That Changed Judaism: Secrets of "The Guide for the Perplexed" by Micah Goodman