Whether or not the therapist should have asked that question depends on whether he thought the information would help him help you or he was just curious. For instance, if you were not capable of having an orgasm now but used to, your therapist may wonder if there is an issue about how you feel about yourself or how you think your partner feels about you.
I had a cis friend, a female, whose therapist asked her if she masturbated. Questions that involve revealing very personal information would make anyone uncomfortable, but those issues may also be part of the reason we are having a problem.
On the other hand, if you are not having any issues in the romance department or questioning your own sexuality, then I would be more inclined to think it was a curiosity question, and that is definately out of line. I left my first endocrinologist I was seeing when I first moved because every time i went in for blood draws, one of the nurses would come in and start asking me questions about my ability to have erections, did orgasms feel the same now etc. She wasn't even the one drawing the blood, nor was she connected to my treatment. She even admitted to being fascinated in "women that turned into men" and wanted to see my package. I wrote a scathing letter to that particular office and found another Dr.
You have every right to your therapist point blank what that piece of information is important. If he can't come up with a reasonable answer without fumbling around, I doubt I'd go back. It must have felt not right to you, or you wouldn't have brought it up.
sam1234