The Torah in Parashat Ki-Teseh (Debarim 22:5) commands, “Lo Yiheyeh Keli Geber Al Isha” – that a woman may not wear clothing designated for men. Targum Onkelos translates this verse as referring to weapons; a woman is not permitted to carry weapons, as waging war is normally a man’s activity. This is stated also by the Gemara, in Masechet Nazir (59a).
The Sefer Ha’hinuch explains that the Torah introduced this prohibition in order to distance us from Zima (forbidden relationships), which he describes as “Mechoar Ba’yoter” – “exceptionally repulsive.” Indeed, the Gemara says that G-d “despises Zima,” and we must therefore avoid activities that could lead to immoral thoughts, which could then lead to illicit conduct. Allowing women to dress like men could result in inappropriate mingling, which could then lead to forbidden relationships, and for this reason, the Sefer Ha’hinuch writes, the Torah introduced this prohibition.
The Sefer Ha’hinuch then cites the Rambam as explaining that the Torah forbade women from dressing in men’s clothing because this was the practice of ancient pagans. The Torah wants us to distance ourselves as far as possible from practices associated with idol-worship, and so the Torah forbade crossdressing, which was customary among the idolaters in the ancient world.
This prohibition applies in all places and in all times. A woman who wears garments designated for men, or who carries weapons, is in violation of this command, and is liable to Malkut.
This verse continues, “Ve’lo Yilbash Geber Simlat Isha” – introducing a prohibition forbidding men from wearing clothing designated for women. This prohibition includes not only crossdressing, but also acting like a woman, specifically, dyeing one’s hair and removing white hairs from his head or face.
This prohibition, too, applies in all times and places, and is punishable by Malkut.

