Uriah's refusal to return to his house was not a quiet, private decision; it was a highly public display right inside the royal compound. He chose to sleep directly in front of the entrance to the king's palace [מצודת דוד]. He did not rest there alone, but rather positioned himself alongside the king's servants, specifically the military guards stationed to watch over the palace grounds [ביאור שטיינזלץ, מצודת דוד].
By choosing to sleep alongside the guards instead of going home, Uriah created a public disgrace. His highly unusual behavior did not go unnoticed, as the king's servants who were present clearly saw and paid close attention to his actions [מלבי״ם].