God gave the Law to Israel because of transgressions and to address the rampant sin that existed before the Law was given.
Watch the Teaching: Why the Law Was Given — Galatians Chapter 3 Explained