The law was not given by God in order to be an agent of condemnation, not for Jews, not for Gentiles, not for anybody. It was given as a guide to living in accord with the law of God, as is obvious from Hebrew Scripture.
No it was given because the chosen people disobeyed God Galatians 3:19 Exodus 20:20; 32; 34