Because the Israelites were ungrateful for what the Lord had done for them and wanted to go back to their old life, the Lord gave them what they grumbled about. Careful what you wish for… There are consequences of being ungrateful.
“Consecrate yourselves for tomorrow, and you shall eat meat; for you have wept in the hearing of the Lord, saying, “Who will give us meat to eat? For it was well with us in Egypt.” Therefore the Lord will give you meat, and you shall eat. You shall eat, not one day, nor two days, nor five days, nor ten days, nor twenty days, but for a whole month, until it comes out of your nostrils and becomes loathsome to you, because you have despised the Lord who is among you, and have wept before Him, saying, “Why did we ever come up out of Egypt?” Numbers 11:18-20