Let me ask you this one question: Did you receive the Holy Spirit by obeying the law of Moses? Of course not! You received the Spirit because you believed the message you heard about Christ. ~Galatians 3:2 NLT
It's sad how as plain as Salvation by grace is, people still think the scriptures teach that for one to have the Holy Spirit they have to live clean, godly lives. That is so far from the truth. One cannot live a holy life without the Holy Spirit. One can never be righteous first then as a reward for that gain the Holy Spirit.
We received the Holy Spirit when we believed in Jesus Christ. We can never earn God's spirit by keeping the Law of Moses, or the 10 commandments or even by following some high morale book written by a famous author. The Holy Spirit is a gift of God. A gift is meant to be received. Just picture this, if you gave your friend a gift and she/he starts trying to earn it... that would be soo awkward.
The Holy Spirit is the gift you get when you believe. Believing the gospel is the only prerequisite. I am fully convinced if God can give you a gift, he won't be coming back days later to take it back. it's now yours. It belongs to you. I believe your behavior cannot make God take back his gift because your behavior in the first place didn't count for him giving you the gift. The bible tells us amazing things about God's gifts:
~ They are good and perfect
~ His gifts are without repentance
"God’s gifts and his call can never be withdrawn." ~Romans 11:29 NLT
The Holy Spirit is good and perfect. He will be with us unto the end of the World. Today may we take a moment to simply acknowledge this gift. Thank God for his Spirit now dwelling in your heart.