Question: how to spawn villagers with doors?
Answer: Make a 6×6 square, with walls, out of your building material. Place 1 door, then a line of cobblestone, then another door for the entrance. Transform two zombie villagers back into villagers. Place two beds.