What David desired is spoken of as if it were an item in a container and the heart as if it were a container. Alternate translation: "Because you desired" (See: [[rc://en/ta/man/translate/figs-metaphor]])
The word "name" is a metonym for the person, and "for ... name" refers to worshiping the person. See how you translated similar words in [1 Kings 3:2](../03/02.md). Alternate translation: "in which people will worship me" (See: [[rc://en/ta/man/translate/figs-metonymy]])
What David desired is spoken of as if it were an item in a container and the heart as if it were a container. Alternate translation: "to desire to do that" or "by wanting to do that" (See: [[rc://en/ta/man/translate/figs-metaphor]])