Since Mary and Joseph were in Bethlehem, they could take Jesus to the Temple for the rite of dedication. Mary and Joseph were giving God's Son back to Him. Jesus would be "set apart" to do everything God had promised about Him. This usually took place when a baby was 40 days old. So the visit of the Wise Men that Matthew tells us about has not happened yet. Mary and Joseph would not take their baby boy born in Bethlehem to Jerusalem if Herod was already trying to identify and kill the "Newborn King."
When we baptize children we promise to raise them in the Christian faith. This is very important. Not only do we need to baptize and raise our children in the Christian faith, we need to set the example. We need to pray, read God's Word, worship Him and live as His sons and daughters in our every day lives. Hopefully our children can "catch" the Christian faith from us.