You will have problems if you teach a child that God loves him ONLY as long as he is good AND that when he is bad the Lord does not love him. When he grows up , if he has a bad temper, he will have the idea that God hates him. He will think God doesn’t love him when he has a bad temper. And, as he has a bad tempter all the time, he will conclude that God does not love him at all, but hates him all the time.
Now God hates sin, but loves the sinner. There is a great difference between the love of God and our love–all the difference in the world between the human and divine love.