It usually implies that someone has first passed through the door. The door is then closed after the person has passed through. Hence the action is "behind him" with respect to the direction in which he's traveling.
A person may close the door behind himself. And person B may close the door behind person A.
Why doesn't that idiot ever close the door behind him[sel
<< Can we say "close a door behind someone" to mean "to go in (a room) through a door, and close it"?>> Yes, except there would be two people involved in the first scenario, and only one in the second..