The fact that it is very, VERY wrong, is what’s making it illegal, nincompoop.
Her marriage status is of no importance whatsoever. The RAPIST is the criminal; it’s what HE (or more rarely SHE) has done that is of importance.
Besides, how the heck would the rapist know whether the woman is a virgin or not? There is no way of determining whether someone (woman OR man) is a virgin. The only way is to ask the person, and they could lie if it suits them, or if it’s dangerous to tell the truth.
If that could keep you from being raped, EVERYONE would say they are virgins. But it won’t, as some creeps would relish raping a virgin. With some potential rapists, it would be better to say that one is NOT a virgin, as that would deter THEM from raping a USED WOMAN. But, there’s also no way of determining which type your potential rapist is, beforehand.