It would also be stupid not to explain to criminals what is the right way. They could always then say, "You never complained before; why now?"
And you know as a military officer that commanded people not to drink and drive that some doofus is going to go out that night, screw up, and you'd have a DUI on your desk to deal with on Monday morning.
Yes, I knew in advance that not all would obey my orders, and could usually know with about 90% certainty who those would be...but the order was a real order, capable of being obeyed, and those who disobeyed would be punished for their disobedience.
However, suppose I ordered someone to flap their arms and fly around the base like a bird. Apart from the fact I would be put into a psycho ward, the airman would have been under no obligation to even try.
A few years back, a Lt Gen (O-9) said he wanted 100 people pulled and sent to an exercise in Korea. The Colonels (O-6) spent about 15 minutes debating how to do it, until the only Lt Col (O-5) - me - said, “General, there is no way no how that we will ever get the money or priority to get 100 people. We have TWO, and have to plan based on reality.”
The Lt Gen smiled a thin smile, said he knew that of course, and it was time to move on to the next topic.
The butt-kissing O-6s didn’t even realize how stupid they looked - but God is neither stupid nor malicious. He doesn’t order us to do the impossible without providing an ‘out’. We cannot obey the law perfectly, but he gave us a different means - faith - and he gave it in Genesis 15, so it wasn’t a new story in the New Testament.