Sex is very different from physical examination at a doctor's office. A doctor may need to do things that you wouldn't do for pleasure but are still important for checking on your health. Some of the things they may need to do may be uncomfortable/painful for some people with vaginas. It's also a psychological thing: pleasure during sex/masturbation has a fairly significant psychological component. It's rarely the case that anyone automatically enjoys any interaction with their genitals (male or female genitals, actually). It's very context dependent and dependent on one's frame of mind. Most people are not going into doctor's appointments with any desire or expectation for pleasure, so the experience is just very different from the get go.
Another possible reason for asking you to take a deep breath is that deep breathing can relax muscles and the mind, which can be helpful during an examination.