God is love; and he that dwelleth in love dwelleth in God, and God in him. John does not say God is loving, which would describe a quality he possesses. He says God is love, which makes it the thing he is.
That sentence is frequently borrowed to mean God approves of whatever we call love. John forecloses that reading by defining his terms in the verses before: Herein is love, not that we loved God, but that he loved us, and sent his Son to be the propitiation for our sins. Love is defined by a specific costly act, not by our feelings about it. The cross is the dictionary entry.
He then draws a conclusion that is hard to escape: If a man say, I love God, and hateth his brother, he is a liar. John is blunt about it — you cannot claim intimacy with a God who is love while holding contempt for someone made in his image. The vertical claim is tested horizontally.
But the passage is not primarily a demand. Its center is confidence: there is no fear in love; but perfect love casteth out fear. Fear, John says, hath torment, and it comes from expecting punishment. If God is love and you are in him, the ground for that particular dread has been removed.