The world in John 3:16 is people from all nations, tribes, tongues, etc. It’s not the love of the world itself. The world is corrupt with sin, death, disease, etc.
This is why Jesus prayed not for the world but His children in the world. We live in the world as pilgrims and strangers. We are not of the world but in it.
John 17 9I pray for them: I pray not for the world, but for them which thou hast given me; for they are thine. 10And all mine are thine, and thine are mine; and I am glorified in them. 11And now I am no more in the world, but these are in the world, and I come to thee. Holy Father, keep through thine own name those whom thou hast given me, that they may be one, as we are. 12While I was with them in the world, I kept them in thy name: those that thou gavest me I have kept, and none of them is lost, but the son of perdition; that the scripture might be fulfilled.