Surgical masks (note the name) protect _others_ from you. (They are unlikely to do much to protect you from others, but I suppose it might be possible under fairly limited circumstances.)
N95 and other test fit respirators protect _you_ from the environment in general. (I suppose they would also protect others from you, but that's really not their point.)
Gloves protect both parties from each other.
When working with highly contagious patients, medical providers wear additional PPE as well (face shields, goggles, suits, etc).
Breaching the skin alone (aka surgery) introduces risks most of us don't have to worry about in our daily lives.
And that's to say nothing of immunocompromised patients (e.g. cancer or transplant).
What's a happy, harmless staph colony on my skin can be very serious for someone else.
Surely you don't suggest the gloves are for protecting the doctor's hands?
Your point is well taken though, I just wanted to clarify for any future readers since misconceptions about PPE seem to abound.