Not a Gender Issue
He allowed a sinful woman to wash his feet before with her tears and hair, which was rather inappropriate for her to do particularly at a dinner she wasn't invited to.
One of the Pharisees asked Jesus to have dinner with him, so Jesus went to his home and sat down to eat. When a certain immoral woman from that city heard he was eating there, she brought a beautiful alabaster jar filled with expensive perfume. Then she knelt behind him at his feet, weeping. Her tears fell on his feet, and she wiped them off with her hair. Then she kept kissing his feet and putting perfume on them. —Luke 7:36-38
Moreover, in general all of the details the Bible gives are important. If this was a gender issue, it would be of little to no theological significance.
The Theological Reason
After Jesus' resurrection, his relation to his disciples changed. They don't recognize him right away in several cases, and in the book of Revelation John has a very different experience of him than leaning on his chest as at the last supper.
When I saw him, I fell at his feet as if I were dead. —Revelation 1:17
Jesus had already told them that when he went to be with the father, he would send another comforter, the Holy Spirit. Thus, even though they had a short period where they sometimes got to see him in his physical body, they were right on the edge of the inauguration of the Holy Spirit's administration of Christ to them. They were about to begin participating in Christ in a deeper, more spiritual way. Thus, the physical affection that they had showed him was no longer appropriate.
Thomas of course touched him in a different way for a different reason—and not in a way or for a reason that he would have done before the crucifixion; it was part of specific purpose of his appearances to them during that time (bearing witness to the resurrection).
Conclusion
Also, the idea of clinging here more than likely does not have a purely physical sense. In John 14 (and the following chapters), Jesus had already had a prolonged discussion with the disciples about him returning to the Father, during which time they expressed great sadness in spite of his insisting that it was better for them. This verse is best viewed in light of that passage; they ought not to cling to him yet, but to cling to him spiritually after he returns to the Father.