On the other hand, if being a rapist IS a mental health issue that can be corrected, then actually correcting it rather than wasting resources locking them up would be better in my books.
The victims might not be happy, of course. On the one hand, I'm not a fan of victims justice. I'd rather people be helped to not be the various degrees and kinds of assholes (whether simply stealing to outright murder and rape), and only lock them up if they can't be helped. I don't want someone thrown away for life if they can be helped, because of a victims revenge desire.
On the other hand, a victim of rape is already fragile, psychologically. I don't know exactly what having their rapist "get off scot-free" would do to that. (read: be incarcerated in a mental hospital and medicated/psychiatrist-at/etc. Not free, but not locked in prison)
It's a mess, basically.
Edit: And I don't want some mess about "Mental issues are differences, you can't just fix someone to be what you like!" I don't expect that for a rapist, but it's possible. I'll be the first to admit that there are certainly many different methods of thinking and feeling, not necessarily better or worse than the norm, that are medicated and treated as "disorders". But if that different method of thinking leads you to raping or murdering people, and otherwise disregarding them and hurting them, then I'm not a fan of just going "Well it's just different!"
I'm all for people doing what they want. That includes wanting to not be a victim of some asshole. AND that includes wanting (or needing :/ It's a bit of a slippery slope to include co-ercive therapy, though.) mental help for anti-social, life-ruining issues beyond your control.