I've seen villagers stay outside all night in some conditions. They seem to think as long as there's a roof over their heads (even just tree leaves) they are safe. If there are no walls around any overhangs, then it's easy for a roaming zombie to wipe them out. The best defense I have found so far (besides iron golumns that I can not yet afford) is to wall of and light up the entire town. They can't go through iron doors if you use a button to open them.
Be sure to pay special attention to the rules for what defines a "house." It's any door with more covered blocks on one side than the other within 5 blocks. If you put your buildings too close together and make them too thin then the OUTSIDE may be considered an INSIDE space by the AI.
XXXX XXX
| X | X
^
This OUTSIDE space has more roof to the left 5 blocks than the right 5 blocks!
XXXXXXX
| X
^
The overhang counts as a "roof" and therefore the left is considered inside by the AI.