My girlfriend's appointment really turned me on and I came on to her doctor
You can't be serious! Why would you do this to the doctor!
Because he was undressing my girlfriend in examination room
This is very odd and you need to stop acting like this. It is not appropriate to come on a doctor.
I know but I couldn't control it.
When you felt yourself getting worked up you should have left the room. In the future maybe you shouldn't attend appointments with your girlfriend.