“The third-century teachers Rabbi Johanan and Rabbi Abbahu debate who is the greater, the man who has never sinned or the sinner who has repented.  Their contemporary, Rabbi Simeon ben Lakish, says…that when the sinner repents, his intentional sins are accounted as if he had committed them unintentionally; but in another version, his sins are accounted as virtues! The Talmudic reconciliation  of the two versions is that one refers to repentance out of fear, the other to repentance out of love.” 
Reb Sigmund Freud taught that there are no “unintentional” sins at all. All of our actions reflect our unconscious intentions and desires. But that’s another topic.
Then, what is the difference between the two “accountings?”
If one’s intentional sins are considered “unintentional,” they’re still considered “sins.” The wrong that was done might be overlooked, but it’s still regarded as a wrong.
If one’s intentional sins are considered to have become “merits,” or “mitzvahs,” they’re no longer considered “sins” at all. In fact, they’re looked on as if the “sinner” had actually done something good!
What is the “good” that was done by the sin?
Resh Lakish is saying that if we repent out of love (for G-d), changing our actions and our inner selves for the better in order to show our love for G-d, the wrong we’ve done becomes regarded as a motivating factor for something positive: It has ended up promoting our personal growth and our closeness to G-d. Also, if part of our repentance involves restitution or some other form of compensatory justice, we end up helping those we’d hurt — sometimes with increased value (as when, in Torah, the thief must return not only what he/she stole, but an additional 20%).
What is the purpose of a “virtue” or a “mitzvah?” It’s to bring us closer to G-d.
Doing a “sin” separates us from G-d. 
But through repenting of a sin out of our love for G-d, we can actually become closer to G-d than if we didn’t sin at all.
“Rabbi Abahu said, ‘Where Baalei Teshuvah [penitents] stand, people who have never sinned [the “righteous”] cannot stand!” 
If we don’t sin — if we do everything “right” — then we feel that our closeness with G-d is a result of our “right action.” There’s some degree of truth to this.
But the one who never sins has controlled, but hasn’t necessarily overcome the inner urge to sin. Doing so can require an appeal to G-d’s help (almost continually, at times).
“You open Your Hand and satisfy every living thing willingly.” 
Also, the one who sins and repents should, according to the strict law of right-and-wrong, “karma,” still be distanced from G-d, because the sin itself isn’t forgotten. But the one who repents discovers that G-d re-accepts him/her as if the sin had never been done. That “acceptance” is G-d’s “midat Hesed;” G-d’s Love; G-d’s “grace.” It’s something far beyond anything we could ever “earn,” given to us freely:
 Berakhot 34b
 Yoma 86b
 Jacobs, Rabbi Louis: Attitudes toward Repentance http://www.myjewishlearning.com/holidays/Jewish_Holidays/Yom_Kippur/Themes_and_Theology/Repentance/Attitudes_Towards_Repentance.shtml?p=1
 Isa. 59:2
 Berachot 34b
 Ps. 145:16
 Kook, Rabbi Avraham Yitzhak HaKohen; Orot HaTeshuvah (The Lights of Penitence) 4:2; Rabbi Ben Zion Bokser, trans.; Paulist Press, © 1978; p. 49