Paul TELLS US that he is speaking TYPOLOGICALLY. That rock was a TYPE of Christ just as the Red Sea crossing was a type of Christian baptism, and the manna from heaven was a TYPE of spiritual food, and the water from the rock a TYPE of spiritual drink - the Lord's Supper. They drank from the rock which Moses struck with his staff and this drink was a typology of Christ as also was the manna. See
John 6. Paul tells us they were under the Law .... UNTIL CHRIST CAME... NOW that faith has come....
Galatians 3::23-25.