Both godliness and sin flow from the fount of faith. That is, we trust God and walk in His will, or we trust somebody else and disobey.
"Therefore I esteem all Thy precepts concerning all things to be right... As for God, His way is perfect" (Psalm 119:28; II Samuel 22:31).
When we sin, we succumb to the temptation that suggests the precepts and ways of God are not right and perfect. We may not consciously realize our trust in dust rather than the Divine, but all unrighteousness flows from the unholy fount of disbelieving God. In the lives of born again believers in the Lord Jesus Christ, this makes sin a very personal matter, and one that should grieve our hearts as we realize we have yielded to the notion that God's precepts are not right, nor are His ways perfect.
Most importantly, we distrust our Heavenly Father's heart when we disbelieve and disobey Him. From the beginning, Satan tempted the human race to believe that God unjustly withholds good things from us. "God doth know that in the day ye eat thereof, then your eyes shall be opened, and ye shall be as gods, knowing good and evil" (Genesis 3:5). Eve succumbed through deception to this lie, and then Adam willfully embraced the dark notion that God cannot be trusted (I Timothy 2:14). Humanity fell into the throes of a natural inclination to question and doubt the only Heart worthy of trust, even as Adam's first actions after sinning involved hiding in the trees because He was afraid of God (Genesis 3:10).
Conversely, godly attitudes, words, and actions originate deep within us as we trust God and submit unto Him in devoted confidence. Salvation in Christ, both in reception and the outworking thereof, are matters of faith. When we believe in the Lord Jesus, the Holy Spirit births us into an existence of trust wherein we come forth from the darkness of our Adamic inclination to unbelief. Deep in our spirits, the light of God shines upon the heart of God, revealing His perfect trustworthiness and faithfulness. We begin a life of faith as the Holy Spirit works in us to believe rather than disbelieve. All true godliness proceeds from this dynamic working of grace, as received by faith. "The just shall live by faith... This is the victory that overcometh the world, even our faith" (Romans 1:17; I John 5:4). Thus, obedience to God originates deep within us as we remember His heart, and determine to believe that "His way is perfect."
Rather than cold, sterile ritualism, the Christian life blesses us with the most personal of all relationships. We seek to "grow in grace and the knowledge of our Lord and Savior Jesus Christ" in order that we may more and more trust the heart of our Heavenly Father (II Peter 3:18). Subsequently, the more we truly know Him, the more we will trust Him. The more we trust Him, the more we will obey Him. And the more we obey Him, the more we discover the faithful heart and perfect way of God. We live by faith because thereby we live in reality, the reality that draws us further and further into the love of Christ, and further and further into conformity to His spiritual and moral likeness.
"Trust in the Lord, and do good."