@Berean ..
To the next verses on your list - 2 Peter 2:20-21
(2Pe 2:20) For if, after they have escaped the pollutions of the world through the knowledge of the Lord and Saviour Jesus Christ, they are again entangled in them and overcome, the latter end is worse for them than the beginning.
(2Pe 2:21) For it were better for them not to have known the way of righteousness, than after knowing it, to turn back from the holy commandment delivered to them.
You ask, why did Peter write these words? It is obvious that Peter was saying there would be many folks after barely hearing about the gospel and the knowledge of how to be truly righteous through Christ that they would maintain and love their own self-righteousness and remain slaves to the way of the world. False teachers of God would always entice and lure them and ensure their self-righteousness is secure. And there are especially many of both types today; the false teacher and the lukewarm false believer of self-righteousness that God utterly detests.
The parable concerning the seed sown on ground full of weeds or thistles suits these self-righteous folks quite well. They were happy to be overcome and choked out by the ways of the world again. They returned to their old ways as verse 22 describes them as dogs returning back to their own vomit.
(2Pe 2:22) It has happened to them according to the true proverb: A dog returns to his own vomit and a sow, having washed, to her wallowing in the mire.
Peter is saying there are many folks that never truly turn to God and his Son. They would rather just sit on the fence and listen and be comforted by boastful and empty words and worldly ideas from false teachers. They were always destined to go back to the world as their hearts would never completely accept the gospel.
They tasted the wine of salvation and still did not take it to heart. They never would make a commitment in their hearts to say without a doubt they loved or hated the spiritual living water of God. To not just taste it, but to drink it all down with joy. God knew of these rejecting folks already.
(2Pe 2:18) For when they speak great swelling words of emptiness, they allure through the lusts of the flesh, through lewdness, the ones who have actually escaped from those who live in error;
(2Pe 2:19) promising them liberty, while they are in fact slaves to corruption. For of whom a person is overcome, of the same is he also brought into bondage.
Verse 18 speak of these folks as newly escapees from the world. They had just heard the gospel of God with the fresh new knowledge of God. They have just placed one step out of the world. Unfortunately, they never were able to move the other foot off from the world as they loved its chains of bondage too much.
They loved their material things, the lusts and sensations of the body, and the comforts of sinning in the flesh. They ultimately determined that their ways were still righteousness to God as they considered themselves good and decent people as many of them attend and are members of a 'church' today.
There were and are never true believers that truly accepted or accept the good news of God, his Son and salvation. These never acquired or acquire the spirit of truth to gain true righteousness. They loved their own righteousness found in themselves and loved by the world.
Bless you,
APAK