This passage appears in the midst of an epistle detailing the problems of a tumultuous congregation. Paul draws on the experiences of Israel in the wilderness as examples to us. He concludes by telling them, despite what manner of sin each individual was involved in, to turn their attention to overcoming idolatry. In others words, idolatry sat at the foundation and was ultimately the cause of whatever their sin happened to be.