Let’s read the context:
1 John 2:15-17 (NASB’95 edition)
15 Do not love the world nor the things in the world. If anyone loves the world, the love of the Father is not in him.
16 For all that is in the world, the lust of the flesh and the lust of the eyes and the boastful pride of life, is not from the Father, but is from the world.
17 The world is passing away, and also its lusts; but the one who does the will of God lives forever.
The word world is used in several different ways in the Bible.
Let me illustrate:
"For God so loved the world, that He gave His only begotten Son, that whoever believes in Him shall not perish, but have eternal life.
Jesus said to His disciples:
"You are the light of the world. A city set on a hill cannot be hidden;
In these passages the word world is used to mean the people who live on this planet. Jesus died for people, not for the planet. There are numerous passages in the New Testament which use the word world in this sense (Matt. 13:38;Luke 2:1; John 6:33,12:19, 12:47, 15:18).
The word world is also obviously used to refer to the earth (Gen.1:1; Psalm 24:1-2; Heb. 11:3). Gen. 1:31 tells us that when the world was created by God that it was very good. God made the world, it is therefore good. This is not what John is referring to.
The Bible also uses the word world to speak of the state of sin that the people of the world live in. James says:
You adulteresses, do you not know that friendship with the world is hostility toward God? Therefore whoever wishes to be a friend of the world makes himself an enemy of God.
Satan is said to be the ruler of this world – John 16:11:
and concerning judgment, because the ruler of this world has been judged.
When Satan is in control of a person’s life, he is under the domain of the ruler of this world. He lives his life in disregard of the consequences of sin. As James says, he makes himself an enemy of God.
Paul wrote in Galatians 6:14
But may it never be that I would boast, except in the cross of our Lord Jesus Christ, through which the world has been crucified to me, and I to the world.
This means that the sinful desires of the world induced by Satan the ruler of this world have been placed under the control of God, through the process of sanctification.
When John says do not love the world he is saying the same thing that James is saying, and that Paul is saying. John defines the way he uses the term world in the context of 1 John 2. Christians do not love the world in the sense that they never allow the sinful desires of the ruler of this world to rule in their lives.