There is merit in not doing something wrong because you don’t want to get caught, but God is also a Father that wants his children to do what is right because he is good.
We walk by faith not sight; Do we obey speed laws when a police car is around then out of sight out of mind? What of a people that obeyed because it pleases their Father in heaven which pleases them as well.
God trust his children knowing they want to please him, even when we fail miserableness God never loses faith in us. He may move mountains to get us back on track because He knows that’s where we really want to be!