Cotton retains moisture. It is not a good choice for underwear, and you have been bothered by it's major flaw. Merino wool, mentioned here, is a better choice. It is superior to cotton in every way but price. It is more comfortable over a wider variety of temperatures. I own several pairs of merino boxers and briefs. However, it is warmer and when the weather is not cold it may be too warm. It also retains noticeably more moisture than high-performance synthetics, linen, or hemp, but cutting-edge fabric blends and technologies are improving merino in this respect, like Nuyarn (offered by KUIU) and Icebreaker's Cool-Lite. The superior new merino blend technologies are new and not yet available in underwear, though. I recommend merino from KUIU, Icebreaker, Smartwool, and Minus33. However, I too have a sweaty groin and I recommend you avoid merino underwear. It's ideal for long johns, shirts, and union suits, but not underwear. It also won't last as long as the alternatives, but that also depends a great deal on your body's sweat and how you wash the garment. I mostly wear UnderArmour boxerjocks. Well made and very long lasting. Get the smooth "original" fabric rather than being tempted by the mesh if you're mostly sitting down, sitting down on a patternless smooth fabric is more comfortable. However, I prefer natural fabrics next to my skin and no longer buy synthetics like polyester and nylon for this purpose. Synthetics worn on the skin immediately begin to smell upon wearing and are very "unfresh" by the end of the day. The best choice is linen or hemp, which both perform very similarly. They're what I'm starting to move to, but I don't have much experience yet. They retain less heat than polyester and release moisture on par, while feeling and smelling much fresher. Rawganique seems to be a good company offering many styles.
Cotton may be less expensive, but it holds sweat more than any other common fabric. Go ahead and pay the $15-30 for a higher-end pair of underwear that will last for years and be significantly more comfortable. You wear underwear every day. You'll be more comfortable every day. You'll notice it and won't regret it, it's a good investment. Underwear will cling to your skin far less often.