Because the law has not kept up with this apparent change in the way in which the words traditionally associated with biological sex are used. Indecent exposure, for instance, refers to "his" genitals. Similarly, Rape can only be committed by a "male". The legislation refers to "his" and "he".
So a woman, with a penis, cannot legally commit indecent exposure, or rape, as the law stands. Im not sure if it's ever been tested in law, yet, but I'm sure it will be, sooner or later
I don't know which jurisdiction you are referring to. In Scotland "rape" is penetration by a "penis".
"Sexual exposure" is exposing genitals for the purposes of sexual gratification or to cause humiliation or offence.
It is completely irrelevant what sex, gender, gender identity or sexual orientation the owner of the penis or genitals is.
From The Sexual Offences (Scotland)Act 2009
^If a person (“A”), with A's penis—
(a)without another person (“B”) consenting, and^
(b)without any reasonable belief that B consents,penetrates to any extent, either intending to do so or reckless as to whether there is penetration, the vagina, anus or mouth of B then A commits an offence, to be known as the offence of rape
Sexual exposure
^(1)If a person (“A”)—
(a)without another person (“B”) consenting, and^
(b)without any reasonable belief that B consents,intentionally and for a purpose mentioned in subsection (2), exposes A's genitals in a sexual manner to B with the intention that B will see them, then A commits an offence, to be known as the offence of sexual exposure.
^(2)The purposes are—
^(a)obtaining sexual gratification,
(b)humiliating, distressing or alarming B.^