Sorry, I am a bit ignorant on the subject and maybe someone can do a better job at explaining. The presentation of jews at the temple was to consecrate the baby to God. Well, at least that is my understanding. And it was also for the purification of the mother after child birth. In the case of Jesus and Mary, Mary was spotless but due to her humility and pbidience, she went into the temple for her purification (again, even though she was already spotless and pure).