If the mouse was trying to come out of the crack, and was still in the wall, then how could he have touched the gloves?
In any case, unless you had mouse droppings on your gloves, which you absolutely would have seen, you had no risk for any kind of bacterial or parasite issue.
If you wash your hands before masturbating with regular soap and water, you don't need vinyl gloves. It's okay to touch your penis with your hands.
If you feel better using gloves, try to get some latex gloves, and use new ones every time. Keep them some place where they won't be exposed to any critters.
And are you isolating right now? Then you have time to fix the crack in your wall. If a mouse can get in it, I'd think you're biggest problem is the foundation of your house.
And this is not an STD question. You can't give yourself an STD you don't have.
Sincerely and with compassion - do you have a therapist? It sounds like you might have OCD. I can't remember if I've suggested that before or not, but if I haven't, I am now. If I have, I'm repeating it and urging you to talk to a doctor.