To love or not to love the world

John 3:16 says that God so loved the world. 1 John 2:15 tells us not to love the world. How does the meaning of "the world" differ in these two contexts?

The apostle John used the same Greek word for “world” in both verses you cited. That word can have various meanings like “universe,” “world,” “the inhabitants of the earth,” “ungodly people,” “that part of the world that is opposed to God” – to mention a few. As you indicated, the context will determine the particular meaning.

John 3:16 occurs in the context of Jesus speaking to Nicodemus about the snake-bitten Israelites who received healing through the bronze snake on the pole. Jesus explained to Nicodemus how that healing account pointed ahead to his redeeming work: “ Just as Moses lifted up the snake in the wilderness, so the Son of Man must be lifted up, that everyone who believes may have eternal life in him” (John 3:14-15). Then comes “the gospel in a nutshell.” “For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life” (John 3:16). “Everyone” in verse 15 and “whoever” in verse 16 are not limiting in any way, are they? “Everyone,” “whoever” they might be, can find salvation in Jesus because God loved the world, the inhabitants of the earth, and sent his Son Jesus into the world to be Savior of all. God does want all to be saved. We find that truth stated elsewhere in Scripture (1 Timothy 2:4, for example).

When it comes to 1 John 2:15, the context paints a contrast between loving the sinful world (“the lust of the flesh, the lust of the eyes, and the pride of life,” verse 16) and loving God. Christians are to love God more than anyone or anything else in life. That is the heart of the first commandment. God calls on us to “reject every kind of evil” (1 Thessalonians 5:22). We are not to love the “world” in that sense.

To pull everything together, then, the “world” in John 3:16 refers to the people of this earth, while the “world” in 1 John 2:15 speaks of anything in this life that is opposed to God and his will.