Well, because he's ill. If his cognitive functions were unable to give him remotely accurate information, and while under that delusion he honestly believed that he and Mary were having consensual sex, then there's no way he can be held accountable for what happened. If that, indeed, did happen.