The Law of the Lord also says that parents have to offer a sacrifice, giving at least a pair of doves or two young pigeons. So that is what Mary and Joseph did.