I attended high school between 2003 and 2007, so right around the time jocks started disappearing from locker rooms, maybe a little bit after. My high school was a bit different. It was an all-guys high school where tradition was big, and generally speaking younger guys just tried to emulate the older guys, which is why a lot of us still wore jocks when most guys at other schools had switched over to compression shorts.
I hear a lot of guys blame the disappearance of jockstraps on the idea that they had become associated with gay sex and gay culture. I think that may be a reason why they're not popular today, but I don't think that's why guys stopped wearing them in the late 90s and early 2000s. Like someone said earlier in this thread, for that to be true, straight guys would have had to be watching or at least exposed to gay porn which, even though the internet definitely made gay porn more accessible around that time, was not happening. I also hear modesty blamed quite a bit. Again, that could be a reason why jocks aren't popular today among the snowflake set, but I don't think it was a factor at the time. At least at my high school, guys reveled in being naked in the locker room. Changing and showering together was a huge part of the bonding experience and the few guys who refused to shower naked were relentlessly taunted.
To me, a major factor in the decline of jockstraps was marketing. You have to remember, in the early 2000s, if you were a young athlete, nothing was cooler or more popular than Under Armour. Guys couldn't wait to go show off their new compression shirt or shorts in the locker room. At my high school, a trend started where guys would intentionally wear very short athletic shorts (at a time when very long shorts were the trend) so that the maximum amount of their UA compression shorts would be exposed. This trendiness was no accident. Under Armour invested very heavily in marketing their product to young athletes. They even managed to make jockstraps cool again for a brief period after they debuted the UA jockstrap in Any Given Sunday (there's an interesting story behind that by the way).
Why did UA invest so much in marketing compression gear? Because it was so cheap to produce. That's what their original business model was essentially built on. Here was a product that required only one, maybe two different materials, could be cheaply and relatively easily assembled, and could be sold for $30-$40. On the other hand, jockstraps required more steps in assembly and usually cost between $10 and $15. There was, and still is, just more profit in compression gear.
On top of making them cool, UA also did a great job in convincing athletes that compression gear would help prevent muscle strain and aid in recovery. It's true, jockstraps were promoted along similar lines for decades. The idea that they prevented things like testicular torsion was a major reason why coaches and PE teachers required them. However, the supposed health benefits of compression gear were just more relatable to most athletes than the supposed health benefits of jockstraps. Think about it. How many people do you know who have suffered from testicular torsion? Now, how many people do you know who have ever pulled a hamstring or been sore after lifting weights? Sure, I think the idea that compression gear prevents muscle pulls is bogus, and while compression does help with muscle recovery, the most popular compression shirts and shorts sold today aren't tight enough to make a meaningful difference. But, if you're a coach or a PE teacher or a team equipment manager, and part of your job is making sure your athletes are wearing gear that offers the most benefit physically, it's conceivable that you could have been convinced compression gear was better than jockstraps.
From that point, I think inertia comes into play. Just like the music we listen to or the cars we think are cool, a lot of guys never really change what they initially got used to in high school. If you started out wearing compression shorts for sports, you'll probably always wear them. Again, I was lucky in that jockstraps were still fairly common at my high school. I got used to wearing a jock for anything athletic in high school and, guess what, I still do and always will! I've given compression shorts a try a few times, but I ultimately always come back to my trusty jockstrap. Why? Because I'm a guy and that's how guys are, set in their ways!
We should also recognize and appreciate reversals in this trend when we see them. For instance, I think cup supporters have made a resurgence. For many years, the trend was for guys to put their cup in the pouch of compression shorts. However, I think that trend has run its course, and now many young athletes are coming around to the realization that wearing a cup in a supporter is way superior to wearing it in the pouch of compression shorts. A big reason I think is just advice they're getting from older athletes who have tried both ways. Also, the folks who make rules for youth sports are emphasizing the need to wear a cup. For instance, a couple years ago, cups were made mandatory for all high school lacrosse players (although refs are not allowed to check for them).
At this point I realize I've written a lot, so I'm going to end this post for now. I want to clarify that what I've written above is meant to address the general decline of jockstraps. I've got lots of thoughts on why jockstraps have declined (or not) in specific sports like football or lacrosse. I also firmly believe that, just as marketing and economics brought about the demise of jockstraps, they could absolutely do the opposite today and bring them back. If folks are interested, I can write more on those subjects later.