It was entirely unnecessary. It served no purpose. I believe that, when handled with respect for real experiences, rape in fiction is generally okay, so long as it's not just a plot device to further the victim's (usually male) partner's emotional growth. See: proposed gang rape plot on Firefly.