I attached my NPC's house to mine so that they had access to both homes but they keep letting monsters in ): Is there a way to fix this?
This has also always bugged me in my first days of Terraria. NPC's are programmed to walk to the left and right, even if there are doors in the way.
What I always do is that I build the NPC building on top of my house, or floating 8 blocks above the ground, so that the mobs can't reach them. From there I connect my base to the NPC building using platforms. Or whatever kind of block you prefer.
Either way, you can't just tell the NPC's not to use doors, the only time that they don't use them is during the night.
You can build a door from three active stone blocks (created from stone + wire) wired to a switch. Neither NPCs nor enemies can open those doors. This solution is obviously only available once you have the Mechanic and can build such mechanisms.
The whole mechanism is shown in this screenshot, though with an additional lava moat in front of the door to kill enemies.
The door in the state where you can walk through
The door in the solid state when it looks just like regular stone wall.
I usually compartmentalized my NPC's in individual rooms using platforms. As long as no door existed, the usually didn't go up and down the platforms to open doors.
NPC's also have a somewhat fixed distance from their home (1 or 2 screens distance) that they can move around.
In contrast with the wire/active stone solution, this is feasible from the start. Just don't have doors in their path.