One of two things, or even both. NPCs do take time to spawn and can only do during the day. As long as there is an acceptable house and no others waiting then its only a matter of time. The other is to check that what ever you built meets the requirements for a NPC to spawn.