Villagers always close the door behind them. The problem is detecting if doors are open or closed, which bugs these guys up. Also, they can't seem to tell if they're aimed correctly at the door. I found a normal village, and villagers were running all over the place, and doors opening and closing everywhere. Villagers running into walls messing with doors. A dragon must have just flown by and everyone was flipping stuff.