Nearly all of the problems "accepting" or understanding evolution stem from the mistaken assumption that evolution has "goals", or "reasons" or even that it is the "survival of the fittest." Essentially, from conceptualising it as an active force.
Mutations happen. Some will cause fewer offspring in the same genetic line, some will cause relatively more. Some just stick around because they are not actively harmful.
Your question has many facets: at its simplest, it could be asserted that the benefit outweighs the hazards. You are already making one assumption, though: that they are external because they need to be cooler than body temperature -- but that relationship could be inverse (and in my opinion actually makes more sense if it is.) And so on and so on.
I know there are exceptions to this rule, like maybe the appendix or the little finger in our feet, but these are exceptions, not the rule.
So I have pointed out the disadvantage of having the testicles placed in an exposed part of the body; I ask, what is the advantage?
You could come up with any number of possible reasons if you were looking for a "reason," although it could simply be a side-effect of some other mutation (such as the layout of the pelvis, intestines and abdominal muscles being more efficient for hunting/etc. without the "extra" parts.)
Here is another important inversion that you seem not to have considered, though: do you think that when externalisation first happened, testicles were as sensitive to pain as they are now?
All of this is to say that being in an easy-to-hit place apparently does not lead to as much evolutionary pressure as contributing to poor hydrodynamics.