Imo no "villain" should think of himself as a "villain". To break laws and do "immoral" things should be a tool to reach a goal that is perceived as "worthy to do whatever is necessary" by the "villain".
For example there are "good reasons" to kill/murder somebody, but that doesn't make it 'right'.
In my opinion the saying "the end justifies the means" is the great divide. If the "end" is (subjectively) valuable enough, everything goes. (without them ever becoming a villain, but an anti-hero)
A little Offtopic: If rape was just half as bad as death in real life - like so many social media warriors like to propagate - the victims wouldn't submit to it. They'd actually fight to the death. Often fear of pain 'or worse' (even implied threats that may or may not just exist in their heads, due to a misinterpretation of a situation) makes the victim not defend itself at all. It's terrible, sure, but if we'd go back 3-5 generations, about 99.99% of all humans have at least one rapist/victim as ancestor.