The question seeks to know specifically why 'hand' is used in Psalm 139:5, and not 'foot'.
First, it is worth noting that the Hebrew word 'yad' for 'hand' is used in Psalm 139:10. Context is the uttermost parts of the sea, where David says of God, "Even there shall thy hand lead me, and thy right hand shall hold me." (A.V.)
But in Psalm 139:5 the Hebrew word 'kaph' is used, which can mean 'hand' or 'sole of the foot'. So, why is not 'foot' used? The context of the whole of that Psalm shows why, for David is adoring the God who knew of him while he was in the womb, who had already determined the length of his days before he was born. David is so confident of the love and care of God for him, whether he ascends to heaven or descends to the depths of the sea, that he cries out to God to search him, to examine his heart and thoughts, to lead him in the way everlasting (vss. 23-24).
If 'foot' had been used, that might have wrongly conveyed an oppressive, domineering act of God. Conquerors are spoken of in the Bible as trampling their defeated enemies under their feet. But given how 'hand' is used three times in those two verses cited, verse 5 points to the hand, although foot is not inappropriate if the subtle nuances of the Hebrew language are appreciated.
The word 'kaphar' comes from the word 'kaph' (which relates specifically to the inside of the hand, the palm.) The outside of the hand, which onlookers normally see, is when work or activity is done; and that which may be seen when a fist is formed. It is 'yad' and is appropriate in vs. 10, for there God's hand is leading David - doing something requiring a grip (even a gentle grip, or a firm grasp). 'Kaphar' means 'containment', a sense of security.
As for vs. 5 where 'kaph' is used, here is a commentary on it meaning 'foot':
"The Hebrew letter Caph, expresses a cupped hand and the word kaph
is also translated, spoon, as when a cupped hand is used to convey
water to the mouth.
The alternative hand word is conveyed by the Hebrew word yad - also
with an accompanying Hebrew letter - and is expressed so often that
Robert Young simply states "frequently" for its usage without
enumeration.
But as to our word, kaph, eighteen times is it used, also, of the
sole of the foot. Evidently, then, it is the tender part, the
sensitive part, of the foot or the hand that is referred to by this
word. It is the inner part; that which feels; that which is intimate.
The fingertips are involved. Some of the most sensitive nerve endings
in the body are included in the meaning of kaph.
It may be, also, that the strength of the use of the arch of the foot
is in view as the root word kaph is used, as we shall see, in words
where load bearing is pertinent.
Not only so, but there is also the idea of the protection offered by a
cupped hand to that which is vulnerable when it is held within it."
The Burden of Sins, pp.69-70, Nigel Johnstone, Belmont Publications, 2013
So, the answer is that David's thoughts here are of God's hand guiding and supporting him, but that the strength of the foot's arch for load bearing would fit in nicely with the concept of the palm of God's hand, regarding God bearing the load of David's sins while his hand contains them. That is why the double-meaning of 'kaph' is appropriate, but the emphasis needs to be on the protection of the hand.