Verse 5 is downright alarming. How many people of the 2 to 2½ million people who came out of Egypt under Moses made it into the Promised Land? Of those aged 20 and older, only two, Joshua and Caleb, along with their families, made it.
Paul uses vivid terminology. He literally says that their bodies were scattered all across the desert. They fell aside as they went along the way and did not make it. They were buried where they fell. The Israelites left a trail of graves all the way from Egypt, through the Sinai, and up into the borders of Israel, the Promised Land.
Such a thing will not physically occur to us. God is working out something different with us than He was with them. With them, He was establishing a type and setting examples for us. We can look at what they did and learn from what occurred to them. We have the Holy Spirit, and they did not. That should make a huge difference!
Paul says that they all went under the cloud and were baptized into Moses. They were not literally baptized in the way we were, but they did pass between the waters. When they went through the Red Sea, they walked on dry land, but the water rose up like walls on either side of them. The apostle Paul uses this as a type of the baptism we go through. They were buried into Moses, as it were, becoming partners in the Old Covenant. Moses, the mediator of that covenant, was a type of Jesus Christ.
Yet, these people died in the wilderness. Here is decisive proof (most of it contained in the record of their wandering in Exodus and Numbers) that though a person physically goes through all the ordinances, it does not mean a thing spiritually.
Verses 1-4 show the Israelites were in the presence of Jesus Christ. He was in the cloud and in the pillar of fire. He was there as the Angel, the Messenger of God, who was leading them through their pilgrimage on to the Promised Land. That is why Paul's illustration is so alarming: One can lose his salvation (not make it to the Promised Land, the Kingdom of God) if he is living a life of divided loyalties (Matthew 6:24).