Examples of people who fell from grace and earned it back? In the bible, it reads (forgive me as I don't have the exact passage) that the Holy Spirit will be given to those who are righteous.  

My question is, are there any examples of people who were favored by God, sinned, and then found favor with God again?
The closest thing to a real concise example is the parable of the prodigal son.

The story is found in Luke 15:11-32

The story starts with the son demanding his share of the inheritance, so, unfortunately, it is a difficult case to make that he found favor with his father in the first place.

The son then leaves his father's house and squanders the inheritance and eventually ends up poor and eating pig slop. While finishing up a big bowl of the stuff he remembers that his father's servants eat better than this, so he decides to go back, ask for forgiveness, and offer to work as lower servant for his father.


  But while he was still a long way off, his father saw him and was filled with compassion for him; he ran to his son, threw his arms around him and kissed him.


Upon seeing him, the father immediately favored his son once more, or rather, never ceases favoring him in the first place.

The father's great cause for celebration is reveled in the last sentence:


  We had to celebrate and be glad, because [my son] was dead and is alive again; he was lost and is found.


A great cause for joy, indeed.