1. Reducing violent crime overall
2. Improving the ability of the justice system to distinguish the guilty from the innocent
3. Increasing reporting of crime, especially violent crime like rape, and support of victims
Presumably the main goal we all want is (1). Not only does this reduce the number of victims and make society safer and more pleasant (less fear), it also reduces the number of people in prison. (3) contributes to (1) in that an unreported crime is unlikely to be punished, and the perpetrator remains free to offend again. (2) contributes to (1) by directing criminals to prison, while leaving the innocent at large. This brings us back to the prison subset of (1), in that by confining criminals - especially violent ones - to prison, we are simply concentrating and containing violence in prisons, rather than allowing it to run rampant in society. As least that is one of the intentions.
Assuming (2) and (3) were done perfectly, prisons would have even more criminals, who prey on each other through rape, beatings, and other acts of violence and domination. This leads to a fourth concern, actually: the nature of the prison system. Balancing the often competing goals of punishment, rehabilitation, and containment has long been a matter of debate. I do not agree that being raped or beaten is an acceptable part of a convict's punishment. The victim blaming comparison with rape outside prison is not valid, however, since people become exposed to prison rape by first committing a crime themselves (using assumption 2), while the revealing dress, flirtatious manner, and sexual habits often cited in blaming women rape victims are not crimes at all. If the only way to keep a convicted rapist from being raped himself in prison is not to send him there, that is unacceptable.
So, we increase reporting of rape, and improve the judicial process better to identify the guilty. As I mentioned before, I would add to that using alternative sentencing options for nonviolent offenders, so fewer of them go to jail. Rape and other violence in prison is best addressed as part of overall prison reform, while rape in the general population must be addressed differently due to significant differences in the environment, for instance the ability to leverage the involvement of bystanders and the higher aspects of social approbation.