Solomon's marriage to the daughter of Pharaoh was a major diplomatic achievement, and initially, the king housed her in the City of David. However, her eventual relocation to a new, dedicated palace was driven by the sacred nature of her original home. The primary approach among commentators is that Solomon did not want a foreign woman living in the holy space where the Ark of God rested [רש״י, רלב״ג, רד״ק, אברבנאל]. To manage this transition with political sensitivity, Solomon did not reveal his religious motives to her. Instead, he presented the construction of her separate palace as a grand gesture of honor, ensuring she moved to her new residence of her own free will [מלבי״ם].
Immediately upon her relocation, Solomon began a major construction project in the adjacent open area known as the Millo [מצודת דוד]. He built up and fenced off this wide space to protect her modesty, filling it with numerous homes to accommodate her extensive royal entourage, servants, and maids [רש״י, רלב״ג, מלבי״ם]. From an urban planning perspective, developing this space created a continuous city layout, allowing the entire royal capital to be enclosed within a single, unified wall [ביאור שטיינזלץ].
Yet, this specific building project stood in stark contrast to Solomon's other public works. While the city walls and storage cities were constructed for vital security and governmental needs, the Millo was developed entirely for the honor and convenience of Pharaoh's daughter [רש״י, אברבנאל]. Because of this, the project carried an undertone of criticism regarding the king's conduct [רש״י]. King David had intentionally left the Millo area open and unfortified so that pilgrims traveling to Jerusalem would have a place to pitch their tents. Expropriating this public space to serve the needs of a foreign princess was viewed as a direct offense to the people, eventually leading to public resentment and a sharp rebuke from Jeroboam [רש״י].
Ultimately, relocating Pharaoh's daughter and developing the Millo were deeply intertwined with the final completion of the House of God. As long as a foreign woman resided in the City of David, the Temple could not achieve its ultimate spiritual perfection [מלבי״ם].