The point of this example is that God's people can practice idolatry, and persisting in idolatry has dire consequences. Paul stressed the similarity of experience that the church, the Corinthian church particularly, and Israel shared by pointing out that each group had its own "baptism"and "Lord's Supper."
10:1-2 Paul did not want his readers to overlook a very important possibility as they thought about eating special meals in idol temples. He reminded them that their fathers in the faith, believers in Israel, were also all under the protective influence of God. The Corinthians knewthese facts from the Old Testament, but they did not appreciate their significance. The cloud that led them in their wilderness wanderings symbolized God's loving care. Likewise they all experienced a miraculous deliverance when they crossed the Red Sea. Moreover all of them associated with Moses who was their leader and God's instrument in their redemption.
Baptism is the outward expression of the believer's identification with the object of his or her faith (cf. Rom. 6:3; Gal. 3:27). Consequently Paul could say the Israelites were baptized into Moses even though they did not undergo literal water baptism in the name of Moses. By following him and submitting to his authority they expressed their identification with him. The parallel with water baptism was most vivid when they went under the cloud and crossed the Red Sea. These experiences constituted a dry baptism for the Israelites.
10:3-4 Furthermore all the Israelites, not just some of them, ate the manna and drank water from the rock. They ate manna throughout their wilderness sojourn (Deut. 8:2-4), and they drank from the rock at the beginning (Exod. 17:1-7) and at the end of it (Num. 20:2-13). Paul called the manna and water spiritual food and drink because God provided them supernaturally and because they have spiritual significance. Both of them point to Christ, the real sustainer of His people (cf. John 6:35, 48-51; 7:37-38). The Israelites thought of God as a rock (Deut. 32: 4, 15, 18, 30-31; et al.). He as a rock, not some physical rock, accompanied them in the wilderness. Their eating and drinking of God is similar to and anticipated the Christian Lord's Supper.
Paul's point in these first four verses was that the Israelites were the chosen people of God just as Christians are now the chosen people of God. God accompanied and provided for them faithfully in the past just as He does for all Christians now.
10:5 In spite of these blessings, similar to those Christians enjoy, God was not happy with His people Israel. He permitted none of the adult generation of military age, 20 years old and older, to enter the Promised Land, except Caleb and Joshua. All but those two individuals from that generation died in the wilderness. How the majority displeased God and lost their privileges follows.