Righteousness is perfect love. God requires righteousness for two reasons: first, because perfect love and imperfect love cannot coexist; and second, because God wants us to experience perfect love.
We can think of it this way. Picture an empty, dark room. When you enter that room and turn on a light, all the darkness leaves. That's because light and darkness cannot coexist. The same is true with perfect love and imperfect love, good and evil. God is perfect love, and anything (or anybody) short of perfect love cannot coexist with God.
In the world, we try to separate good from evil as best we can. Sometimes we put people in jail. Other times, we stop being friends with people who cause us grief and try to harm us. We do this because it is impossible for good and evil to coexist. Evil wants to cause harm, destroy, and kill, but good wants love, peace, joy, and life. God's Word says, "For what do righteousness and lawlessness share together, or what does light have in common with darkness?" 2 Corinthians 6:14.
God wants us to experience righteousness (perfect love, perfect goodness). He wants to keep all evil away from us, and there will come a time when He does just that for us - when God will separate good from evil. In Matthew 25 we read:
"But when the Son of Man (Jesus) comes in His glory, and all the angels with Him, then He will sit on His glorious throne. And all the nations will be gathered before Him; and He will separate them from one another, just as the shepherd separates the sheep from the goats; and He will put the sheep on His right, but the goats on the left.
Then the King will say to those on His right, ‘Come, you who are blessed of My Father, inherit the kingdom prepared for you from the foundation of the world. For I was hungry, and you gave Me something to eat; I was thirsty, and you gave Me something to drink; I was a stranger, and you invited Me in; naked, and you clothed Me; I was sick, and you visited Me; I was in prison, and you came to Me.’ Then the righteous will answer Him, ‘Lord, when did we see You hungry, and feed You, or thirsty, and give You something to drink? And when did we see You as a stranger, and invite You in, or naked, and clothe You? And when did we see You sick, or in prison, and come to You?’ And the King will answer and say to them, ‘Truly I say to you, to the extent that you did it for one of the least of these brothers or sisters of Mine, you did it for Me.’
Then He will also say to those on His left, ‘Depart from Me, you accursed people, into the eternal fire which has been prepared for the devil and his angels; for I was hungry, and you gave Me nothing to eat; I was thirsty, and you gave Me nothing to drink; I was a stranger, and you did not invite Me in; naked, and you did not clothe Me; sick, and in prison, and you did not visit Me.’ Then they themselves also will answer, ‘Lord, when did we see You hungry, or thirsty, or as a stranger, or naked, or sick, or in prison, and did not take care of You?’ Then He will answer them, ‘Truly I say to you, to the extent that you did not do it for one of the least of these, you did not do it for Me, either.’ These will go away into eternal punishment, but the righteous into eternal life."