The bible make us to know that even before the world was created God knew us and loved us. Before you and I burst into the scene screaming and causing mayhem God knew us. He'd always known about the drugs, abortion. backbiting, lies, hurts, unrequited love, the pain, the dysfunction etc. He'd known about the many times we would deliberately ignore His truths in mindless pursuits only to return broken like the prodigal son yet He is out waiting for us to come back JUST BECAUSE.....
1 John 4:19 says God first loved us!! There is nothing you and I have done or would ever do that will qualify us for His love if not for GRACE...Its nothing but grace-unmerited favour and inexplicable love.
If I were God I would have given up on me but God is not man neither are His ways and thoughts.
With man one good turn deserves another but God loves JUST BECAUSE. You don't have to slave away to earn His good pleasure but neither is His love licence to sin.
So stop trying to rationalise the hows and whys, simply accept that that God loves you JUST BECAUSE HE IS LOVE. And that settles it!!