Many commands are written in the Bible in the masculine as
opposed to using gender neutral terminology, which is something
that is very modern and would not have worked for Bronze Age
Tribesmen who were used to very masculine provisions. As the
revelations were, they were as far shifted to the feminine as was
possible at that point. However, a number of sins that are written
in the masculine such as homosexuality, the various forms of
incest, all of the ten commandments, the majority of compensation
issues, and a large number of agricultural provisions. If a person
were to hold that the genders written in the Bible were to be held
in an exclusivist way, that is to say that male commands apply to
men exclusively and female commands apply to women exclusively,
women would not be prohibited from murder, theft, incest, adultery,
and idol worship, among other things. The exclusivist way of
interpretation makes no sense when taken to its logical
conclusion.
As for this particular question, removing exclusivism from the
Bible solves this problem. As a second note, the reason why this is
written in the feminine is that a wife's association with a
different man was much more likely to be an adulterous affair in
the Ancient Period where women were supposed to stay at home than a
man's association with another women which was much more
in-passing.