I'm not a doctor, OP, but I have a strong suspicion that you're afflicted with Intertrigo, aka prickly heat, aka diaper rash. This can quickly develop in areas where the skin is rubbing against another part of the body, aggravated by dampness. Intertrigo is caused by damp skin and once it sets in, it will make the area wetter and produces an *incredibly* noxious funk.
It's caused by bacteria that quickly populate in areas that are damp and dark. Left unattended, it will progress to the point where shallow open sores develop that weep fluid.
It most commonly appears in the areas of the genitals, the butt crease, groin creases, armpits, and under the breasts - basically, any area where skin may be rubbing and gets/stays damp.
If it's intertrigo, it can be cleared up quickly and easily, but it will also come back quickly if conditions revert back to what caused it. To treat it, wash the area gently but thoroughly with water and get it absolutely dry. It must be dry - use a blow dryer or tuck a small hand towel down there for several minutes to completely dry the area.
The treatment/preventative of choice are skin barrier products containing dimethicone. Dimethicone drys to a slightly slick surface that allows the skin to slide instead of chafe while acting as a moisture barrier at the same time. If you don't have open sores/painful spots, you can wash the area, dry it thoroughly, apply the skin barrier product, and let it dry before getting dressed. Reapply once or twice during the day. If you do have sores or painful spots, applying the skin barrier may sting or burn. In that case, you should fold a clean dry large cotton hankie around your balls and keep it there, changing it at least daily, until the area heals, at which point you can start applying the barrier cream.
Intertrigo will clear up in just a few days if the area is kept clean and dry.
Dimethicone skin barrier creams are what the hospitals used in these cases (this is actually quite a common malady - anyone with sweaty chafing skin can get it), but another popular preventative is applying a stick-type antiperspirant to the area. That doesn't work quite as well as the dimethicone, but almost everyone has it on hand, and it is cheaper.
Here's the thing: if you get intertrigo once, it's likely to come back unless the area is kept scrupulously clean and dry. That might mean washing and drying the area a few times a day, or using a skin barrier product faithfully. If it does come back, wash it, dry it, keep it dry, and it'll clear up really fast again. If you're out hiking or in a situation where you can't attend to your personal hygiene as you normally would, dry the area with some kleenex, then tuck a few more in the area to absorb the ball sweat (changing regularly) until you get back to civilization.