As human beings, we are all prone to have selfish motives. It is unnatural for us to always desire something that is selfless and godly. King David knew this and recognised his inability to have a clean heart by his strength so he depended on God to create in him a clean heart and a right spirit.
God is able to do for us the things we cannot do by our willpower and strength. If we let him, God is able to create in us hearts that are motivated to bring glory only to God.