Why did God give the Ten Commandments to his people, knowing that they wouldn’t be able to live up to them perfectly?
Why give anyone a set of laws knowing that they either can't or simply won't keep them? God gave the people the law for the same reason any other authority...