Why could not Mary Magdalene touch the resurrected body of Jesus? In John 20:17 it is written that, when Jesus appears to Mary Magdalene after resurrection, He says to her:


  Do not touch me, for I am not yet ascended to my Father


However, Jesus does tell to other disciples to touch Him, after resurrection. For example, later on, in John 20:27, when Jesus appears to His disciples for a second time and Thomas (the Doubter) is with them, He says to Thomas:


  Put your finger here; see my hands. Reach out your hand and put it into my side. Stop doubting and believe.


Similarly, in Luke 24:39 it is written that post-resurrection Jesus said to His disciples:


  See my hands and my feet, that it is I myself. Touch me, and see. For a spirit does not have flesh and bones as you see that I have.


Thus, I fail to understand why Jesus would negate Mary Magdalene to touch Him but not to His disciples.

How have theologians and the teachings of Catholic, Anglican, Orthodox or Protestant churches interpreted the words of Jesus to Mary Magdalene? How is the fact that He had not yet ascended to the Father related to Mary not touching Jesus? Surely, once He was gone to the Father, it would be impossible to her for touching Jesus!

One possible explanation is that Jesus did not have a physical body (e.g. this or this  discussion). Personally, I do not believe this was the case, as it it at odd with the other texts (where Jesus says that "a spirit does not have flesh and bones as you see that I have"). Neither did Aquinas.
A question from readers in a Watchtower magazine addresses this subject very well. It approaches this seeming conflict by examining the original language of the verses and what the literal original meaning would have been. Your question may be a duplicate of one already asked here on CSE. However below is an answer that I found plausible:

Why did the resurrected Jesus invite Thomas to touch him yet stop Mary Magdalene from doing so earlier?
Some older translations of the Bible give the impression that Jesus told Mary Magdalene not to touch him. For instance, the King James Version renders Jesus’ words: “Touch me not; for I am not yet ascended to my Father.” (John 20:17) However, the original Greek verb, which is usually translated “touch,” means also “to cling to, hang on by, lay hold of, grasp, handle.” Reasonably, Jesus was not objecting to Mary Magdalene’s merely touching him, since he allowed other women who were at the grave to ‘catch him by his feet.’—Matthew 28:9.
Many modern-language translations, such as the New World Translation of the Holy Scriptures, The New Jerusalem Bible, and The New English Bible, help us to understand the real meaning of Jesus’ words by rendering them: “Stop clinging to me.” Why would Jesus say that to Mary Magdalene, who was a close associate?—Luke 8:1-3.
Evidently, Mary Magdalene feared that Jesus was about to leave and ascend into heaven. Moved by her strong desire to be with her Lord, she was holding fast to Jesus, not letting him go. To assure her that he was not yet leaving, Jesus instructed Mary to stop clinging to him but instead to go and declare to his disciples the news of his resurrection.—John 20:17.
The exchange between Jesus and Thomas was different. When Jesus appeared to some disciples, Thomas was absent. Later, Thomas voiced his doubts about Jesus’ resurrection, saying that he would not believe it unless he saw Jesus’ nail wounds and put his hand into Jesus’ speared side. Eight days later, Jesus again appeared to the disciples. This time, Thomas was present, and Jesus invited him to touch the wounds.—John 20:24-27.
Thus, in Mary Magdalene’s case, Jesus was dealing with a misplaced desire to prevent him from leaving; in Thomas’ case, Jesus was helping someone who had doubts. In both instances, Jesus had good reasons to act the way he did.

Why did the resurrected Jesus invite Thomas to touch him yet stop Mary Magdalene from doing so earlier?