When reading the Bible, it is important to keep in mind the contexts of the Old and New Testaments. Both are historical accounts of the happenings during the eras they report on. But in the Old Testament, God is dealing with an unregenerate people. Their spirits are still dead inside them, and God speaks to them as such. The Old Testament has many layers of purpose besides being historical. Included, it relates the law which God proscribed Israel to follow, it points to the redemption of mankind through the Messiah, and serves as a shadow of the New Covenant.
Therefore let no one pass judgment on you in questions of food and drink, or with regard to a festival or a new moon or a Sabbath. These are a shadow of the things to come, but the substance belongs to Christ.
They serve a copy and shadow of the heavenly things. For when Moses was about to erect the tent, he was instructed by God, saying, “See that you make everything according to the pattern that was shown you on the mountain.”
For since the law has but a shadow of the good things to come instead of the true form of these realities, it can never, by the same sacrifices that are continually offered every year, make perfect those who draw near.