Things in the Old Testament were given for us to have examples of what to do and what not to do. Paul shows us this.
1 Cor 10:6
6 Now these things were our examples, to the intent we should not lust after evil things, as they also lusted. (KJV)
1 Cor 10:11
11 Now all these things happened unto them for ensamples: and they are written for our admonition,
upon whom the ends of the world are come. (KJV)
Obviously Paul is reciting some of Israel’s history for us…