Sleptatthedoor - That is, in one of the apartments or niches in the court of the king's house. But in Bengal servants and others generally sleep on the verandahs or porches in face of their master's house.
Matthew Henry
Concise Bible Commentary
Giving way to sin hardens the heart, and provokes the departure of the Holy Spirit. Robbing a man of his reason, is worse than robbing him of his money; and drawing him into sin, is worse than drawing him into any wordly trouble whatever.
SDA Bible Commentary (limited)
Volume 1-7
9. Slept at the door. Probably in the guardroom at the entrance to the palace, with the troops who were stationed there (see 1 Kings 14:27, 28). There is no evidence that Uriah had suspicions of his wife’s misconduct with David. He declared his course to be that of a loyal, upright, conscientious soldier who wished to do what was scrupulously right under the circumstances.