Really, come on. Like if nowadays you could get STDs in hospitals. If you get one either you had sex and are a stupid liar (I swear, I got it in the public toilet) or you're just some dumb junkie.
Also, there are a lot of STDs. So if there is the slightly tiny chance you got it from some accident, was she talking about HIV? Because if she was then she has a pretty valid point. If she was talking in STDs in general I'd reconsider being with her.
If your girlfriend is saying she would leave you if you ever got an STD, from something other than sex, it means she doesn't think your relationship is forever. If she thought she'd be spending the rest of her life with you, it wouldn't matter.
I don't think she's concerned as much about any health issues as she is about where you actually got that STD from. Unless you're getting a blood transfusion from a hobo in a van, I think you're pretty safe from that. To me (and probably to her too) it sounds a bit like you're creating a very specific hypothetical situation with very low chances of happening just to see if your back-up excuse would work in case you actually got an STD from a valid source (aka a hooker).
Even if a girl is willing to stay with you no matter what you do, if you present her with a hypothetical situation in which you're making a fool of her, she's still going to stick to her pride and say, at that moment, that she's not going to have it. She's not going to create this image of her as a spineless rag that if you cheat on, she's just going to let it go cause she loves you so much.
First of all, it would be highly unlikely that you got an STD in that way, so even if you did, shes assume you got it from some diseased hootch working the corner, and that thought's going to be in her head.
Also, it completely her right to feel that way, she was honest with you, you rather she lied to make you feel better? I really don't think you should be questioning your relationship from that answer. That's a hard thing. Besides that in the end, you're getting worked up about a theoretical scenario that most likely isn't going to happen to you.
Remember that you're external doubts like this, or really more reflections of your own inner doubt. You're questioning whether she loves you based on a hypothetical question, and an extreme one at that. I think you're way of looking at her answer is very black and white, and honestly quite selfish. You're saying that you always put her first, which first of all sounds like your putting her on a pedestal, which you shouldn't; yet, in you're hypothetical situation, you aren't doing that, you're selfishly expecting her to stay with you and risk also getting the same disease. If you were really honest about putting her first you'd understand and not want to risk giving it to her.