I don’t know why you would think that God loves sinners but not the righteous. I think you may have misunderstood Jesus words in:
Matthew 9:17 For I did not come to call the righteous, but sinners, to repentance
Mark 2:17 When Jesus heard it, He said to them, "Those who are well have no need of a physician, but those who are sick. I did not come to call the righteous, but sinners, to repentance"
God cannot work with someone who does not realize their need for Him. If they think they are "righteous" in themselves, they will see no need to seek God's mercy and forgiveness. True righteousness is a gift from God. Everyone must come to God conscious of their need and sinfulness no matter how "good" they think they are. This is perfectly illustrated in the story of the Pharisee and the Publican:
Luke 18:9-14 And he spake this parable unto certain which trusted in themselves that they were righteous, and despised others: 10 Two men went up into the temple to pray; the one a Pharisee, and the other a publican. 11 The Pharisee stood and prayed thus with himself, God, I thank thee, that I am not as other men are, extortioners, unjust, adulterers, or even as this publican. 12 I fast twice in the week, I give tithes of all that I possess. 13 And the publican, standing afar off, would not lift up so much as his eyes unto heaven, but smote upon his breast, saying, God be merciful to me, a sinner. 14 I tell you, this man went down to his house justified rather than the other: for every one that exalteth himself shall be abased; and he that humbleth himself shall be exalted.
Jesus was talking about people who thought they were "good" and had no need of God's mercy. They thought they were righteous but really they were only "self-righteous." God wants everyone to turn from sin to righteousness but on His terms.
Ezekiel 33:11 Say unto them, As I live, saith the Lord GOD, I have no pleasure in the death of the wicked; but that the wicked turn from his way and live: turn ye, turn ye from your evil ways; for why will ye die...
We all sin and we all die.
Romans 5:12 Wherefore, as by one man sin entered into the world, and death by sin; and so death passed upon all men, for that all have sinned:
God provided his son to provide a way whereby sinners can turn to God and live.
Romans 5:8 But God commendeth his love toward us, in that, while we were yet sinners, Christ died for us.
Luke 5:31 And Jesus answering said unto them, They that are whole need not a physician; but they that are sick. 32 I came not to call the righteous, but sinners to repentance.
Luke 15:10... I say unto you, there is joy in the presence of the angels of God over one sinner that repenteth.
Matthew 5:20 For I say unto you, That except your righteousness shall exceed the righteousness of the scribes and Pharisees, ye shall in no case enter into the kingdom of heaven.
Those who continue in sin will not see life.
John 8:24 I said therefore unto you, that ye shall die in your sins: for if ye believe not that I am he, ye shall die in your sins.
God has provided a way whereby we can be saved from sin and death.
Mark 16:15 And he said unto them, Go ye into all the world, and preach the gospel to every creature. 16 He that believeth and is baptized shall be saved; but he that believeth not shall be damned (condemned).
Remission of sin is only possible by obedience to the gospel of Christ. We cannot save ourselves by our own righteousness, only by having the righteousness of Christ imputed to us by belief and obedience.
Romans 4:3 For what saith the scripture? Abraham believed God, and it was counted unto him for righteousness... 23 Now it was not written for his sake alone, that it was imputed to him; 24 But for us also, to whom it shall be imputed, if we believe on him that raised up Jesus our Lord from the dead;
Acts 2:38 Then Peter said unto them, Repent, and be baptized every one of you in the name of Jesus Christ for the remission of sins...
Salvation is by resurrection from the dead to eternal life in the kingdom of God when Christ returns.
1 Corinthians 15:20 But now is Christ risen from the dead, and become the firstfruits of them that slept. 21 For since by man came death, by man came also the resurrection of the dead. 22 For as in Adam all die, even so in Christ shall all be made alive. 23 But every man in his own order: Christ the firstfruits; afterward they that are Christ’s at his coming.
All will be judged on their obedience to the gospel.
Acts 17: 30... God... now commandeth all men every where to repent: 31 Because he hath appointed a day, in the which he will judge the world in righteousness by that man whom he hath ordained; whereof he hath given assurance unto all men, in that he hath raised him from the dead.
Romans 2:16 In the day when God shall judge the secrets of men by Jesus Christ according to my gospel.
I hope you have found this helpful.
May God bless you,