Matthew includes Rahab in the genealogy of Jesus to show us that God's heart is to rescue sinful people from all nations. It is the gift of God to bring the outsider in to the family of God by grace through faith.