Whenever I celebrated Purim in Me’ah Sharim, the Haredi epicenter of Jerusalem, I always marveled at the costumes the Haaredim used to wear. Every year, the Haredim participate in cross-dressing. Haredim in drag. What a sight to behold. Haredim and Hasidim literally let their hair down.
Any good Christian bible reader knows that cross-dressing is forbidden in the Torah. Men are forbidden to dress as women, since the proscription reads, “neither shall a man put on a woman’s garment, neither may a man wear a woman’s garment ” (Deut. 22:5).
The law aims to maintain gender distinctions, while preventing potentially licentious behavior. Cross-dressing during Purim is nothing new in Halachic literature; pious Jews have been cross-dressing on this holiday for several centuries.
In the 16th century, somebody asked Rabbi Moshe Iserseles (a.k.a., “Rema”), whether cross-dressing on Purim was permitted or not. Rema cites two opinions, one says, “Yea!” while the other says, “Nay!” (and the cross-dresser says, “Hurray!”). Rema rules that it is permitted to follow the more lenient opinion. 
Rabbi Israel Meir Kagan (1838-1933), author of the Mishnah Berurah, cites several halachic authorities who recommend that the custom of Purim cross-dressing be abolished and prohibit this practice.  R. Kagan notes, “Likewise, as far as I can see, the vast majority of later rabbis who discuss this issue in their Responsa is to prohibit the practice, citing other earlier authorities who call it wicked.”
Based on Jungian psychology, the Haredi cross-dressing reflects the men’s unconscious desire to consciously integrate its feminine side, which he terms the anima.
In a sexually repressed and rigid society where the anima is not integrated with the animus, people will inevitably but unconsciously try to unite feminine and masculine aspects of their personalities together. While cross-dressing may look like innocent fun, the Purim celebration really “masks” (pardon the pun) a much different kind of psychological dynamic that may not be too obvious to the non-discerning eye.
In broad terms, the entire psychological process of the individual, men need to get in touch with their anima development by becoming aware of his feelings and emotions. By doing so, men will gradually become more receptive to experiencing broader spirituality that will enable them to get in touch with the intuitive processes, creativity and imagination. Ultimately, he will show more psychic sensitivity towards himself and others.
 O.H. 696:8.
 Cf. Shach an dCTaz on YD 182.
 MB on O.H. 696:8.