Went to the doctor for testicular pain that I started noticing after I was smoking and masturbating, turns out I had a torsion of the appendix testis. Basically there is a vestigal appendage in over 50% of all males, located on the testicles. It can cause pain and swelling and goes away usually within a week. Not very serious at all. But like you all, I had pain within the testicle
Anyway, from what I've been seeing all across the internet, I've self-hypothesized what the reason. I could totally be wrong, but check it out.
When you smoke weed it increases your heart rate, which in turn increases blood pressure. When you have issues that deal with inflamation or infection or something of the nature, the increased blood flow to the inflamation will cause it to flare up and cause more pain, swelling, etc. I've noticed this not only with my testicular inflamation, but also other infections that I've had at all different parts of my body. My friend who had epididymitis had the same happen to him, so I'm almost positive this is what's causing the pain; the increased bloodflow.
Basically, until the problem is sorted out, it's going to hurt when you smoke weed. So chill for a little bit with the ganja, and resolve the issue at hand.
Again, this is just my hypothesis based on the minimal information I've accumulated through biology, anatomy, and physiology classes that I've taken over the years and all the weed that I've smoked. I could be completely wrong on this one, but it seems to make sense to me.
And if it's just all in our heads, looks like I found a good way to trick myself into not feeling any pain