The Philistines were an imposing enemy and an overwhelming threat to the Israelite’s very existence. Goliath taunted them daily. When David heard the giant’s challenge, and the rewards offered to the one who could defeat him, he was all ears. David’s motives were not entirely pure.
Like David, we often act with mixed motives. When we face challenges that threaten to break us, our intentions can be conflicted. God loves us enough to bless us any way, and gives us a pure heart when we confess our struggle.