The behaviour of an organism, like any other characteristic such as morphology, is indeed a product of natural selection. This doesn't, however, mean that behaviour is somehow "coded in the genes", or that behaviour having a genetic basis is "determined".
There are some simple behaviours which do seem to have a straightforward genetic basis (for example song pitch in crickets) but at least in the kind of animals that commit rape and murder, biologists often consider evolution to have acted on the
capacity to behave rather than on complex social behaviours themselves. So few biologists would claim that there is "a gene for" murder, or that there is "a gene for" rape, or that there is "a gene for" preferring Bach to Mozart. But there are a whole load of genes which, working together, endow us with complex brains and nervous systems, which are capable of a wide variety of behaviours that were not "selected for" by evolution - like arguing about creationism over the internet. for example.
So the answer is a resounding yes: our behaviour is a product of natural selection. But this has no bearing at all on whether rape is justified, "good for the species", or anything like that.
Hope this helps.