I fail to understand why these two things are related, that of you having worked as an escort in the past and wanting to work in the IT industry now. With that said:
1) Why is it the interviewers' business how you paid for your studies? It sounds like this interviewer was trying to get a rise out of you, and they got it. That interviewer is, pardon my French, a total asshole, and you should not want to work at that company anyway. In fact, if I was you I would report that interviewer to the recruiter and explain the situation; if I was that interviewer's boss I would at least ban them from ever conducting interviews again, or perhaps even fire them for such egregious behaviour. In future, if you are asked this question, I would simply ask back "why is this relevant to the job?". Unless they can give me a satisfactory answer, I would simply refuse to answer the question, and worse case simply walk out of the interview. A satisfactory answer would include something like "we want to know if you have a criminal record" or something to that effect, to which I would reply "I did nothing criminal, and indeed you will of course be doing a criminal background check on me prior to employment, so if there's anything to be found you can know it at that time; for now I believe there is nothing you need to know".
2) By nature of the fact that you have paid for your school and graduated and are searching for a "real", above-board job, you have changed who you are now. You aren't the same person you were then. Yes, in the past you may have done XYZ which you didn't want to do, but you stopped doing that. So if someone brings it up directly, just say something like "yeah, I did that, but I don't do that anymore, I'm trying to get a real job". And if they try to bring it up indirectly as this person did, simply play dumb about it and force them to bring it up directly. In this case, rather than being flustered, the conversation could have gone something like this:
Interviewer: May I ask, how did you pay for your studies?
You: Why would you like to ask that? Is it important for the position I am interviewing for?
Interviewer: Well, did you do something that we might want to know about?
You: I dunno, I had my methods of making money, I worked some part time jobs, you know, the usual stuff...
Interviewer: And what did you do to make money?
You: I dunno, some odd jobs here and there, helping out friends, etc., parents helped me some...
[continuing on like this, until...]
Interviewer: Were you ever an escort or something like that?
You: Hang on a second. I know you are taking notes about this interview, and from this point on I would like to do the same. I'm going to be voice recording the remainder of this interview. [take out your phone and start voice recording] Can I ask you to repeat your question for my notes?
At this point the interviewer has a choice: With knowledge that they're being recorded, they can choose to repeat the question, or they can choose to not repeat the question. If they choose the latter, the conversation might go something like:
Interviewer: No, I don't think I want to repeat that question.
You: Fair. Then I will choose not to answer. However, as a note, the question that is not being repeated was with regard to an accusation that I may or may not have been an escort in the past. For completeness, I will continue recording the remainder of this interview for my personal notes. [and then continue the interview but do not turn off the voice recording.
They may also choose to press you, in which case it might go something like this:
Interviewer: [repeats question]
You: Do you know something I should know about? Are you accusing me of something? Do I look like an escort to you?
Interviewer: Well yeah, I mean I definitely was your client when you were an escort...
You: First of all, the mere suggestion that I was an escort is sexual harassment. Secondly, the fact that I may or may not look like an escort that you previously frequented has no bearing on my readiness for this job. Thirdly, even if I was an escort, that's making money, that's a job. There's nothing wrong with being an escort.
Interviewer: Well, yeah, escorts are [whatever negative connotation they may want to add]
You: Are you implying those things about me?
Interviewer: Yeah, I mean, if you were an escort, then...
You: There is nothing wrong with being an escort. There may be something wrong with perverted people who frequent escort services though. This interview is over. Also I will be filing a sexual harassment case against you personally through your HR department, which I will also CC to my recruiter, your company's CEO, and [your local news outlet of choice]. Goodbye. [and then walk out of the room, collect the appropriate email addresses from reception who will likely give them to you especially if you provide context for why you need them, and send the appropriate emails]
(Of course, at any point, the interviewer can simply choose to drop the subject and continue on in a different way, which will cause this conversation to end; this is just the worst-case scenario being illustrated)
The important part here is that you never actually admit to being an escort. You simply continue to play dumb, all the way to the end. Do not admit to anything, and allow the interviewer to continue raising the stakes of their accusations more and more, and always keep plausible deniability. For example:
"I was an escort" -> "Do you think I look like an escort?"
"You frequented me as a client when I was an escort" -> "Maybe I look like an escort you frequented"
"I made money as an escort" -> "Escorts make money"
All of these are true statements, but none of them apply directly to you unless you admit it.
Most of the time, things like this are better left in the past, for both parties. Most normal people will not raise them, indeed ever, and then if they do they will do it in a much more discreet way than this. I wouldn't worry about it for the future, this is probably just a one-off instance.