Scripture does not say. However, we might speculate that the reason was because Herod apparently limited the murder to the region (Matt. 2:16) where he knew the Messiah was to be born (Matt. 2:1-6). So far as we know, St. John the Baptist and his parents did not live in Bethlehem or its neighboring region – otherwise Mary and Joseph could have stayed with them when searching for a place to stay while in the area for the enrollment (Luke 2:4-7) – but in the hill country, in an unnamed city of Judah (Luke 1:39-40), which may have been distant enough from the attack directed by Herod to protect the infant St. John the Baptist.
DISCLAIMER: Catholic Answers has turned over the archive to Catholic-Questions.org and no longer owns, manages, or moderates the forums. For additional apologetics resources please visit www.catholic.com.