Casting lots was a common practice in the OT. The practice of casting lots occurs most often in connection with the division of the land under Joshua (Joshua chapters 14-21), a procedure that God instructed the Israelites on several times in the book of Numbers (Numbers 26:55; 33:54; 34:13; 36:2).
God allowed the Israelites to cast lots in order to determine His will for a given situation (Joshua 18:6-10; 1 Chronicles 24:5,31).
Various offices and functions in the temple were also determined by lot (1 Chronicles 24:5, 31; 25:8-9; 26:13-14).
The sailors on Jonah’s ship (Jonah 1:7) also cast lots to determine who had brought God’s wrath upon their ship.
God allowed the Israelites to cast lots in order to determine His will for a given situation (Joshua 18:6-10; 1 Chronicles 24:5,31).
Various offices and functions in the temple were also determined by lot (1 Chronicles 24:5, 31; 25:8-9; 26:13-14).
The sailors on Jonah’s ship (Jonah 1:7) also cast lots to determine who had brought God’s wrath upon their ship.
Notice that Jonah didn't do it? The sailors did it. Just because the people are so ignorant of GOD's way, and very likely were influenced by the occult, doesn't mean that is how GOD operates.