59 When God heard them, he was furious; he rejected Israel completely. Psalm 78:59
Certainly God knew what Israel was up to as they made their way to the high places. It wasn’t as if it took Him by surprise that one day they’re fine and the next they are involved in all kinds of godless shenanigans.
No, He saw them every step of the way. It wasn’t until they had crossed the line of the high places that He took action against them.
The thing is, they didn’t start sinning when they arrived at those high places. Making the decision to go up was a conscious effort on their part to sin. They knew what they were going to do long before the activities at the high places began.
No temptation has overtaken you except what is common to mankind. And God is faithful; he will not let you be tempted beyond what you can bear. But when you are tempted, he will also provide a way out so that you can endure it. 1 Corinthians 10:13