The social part comes from putting too much emphasis on the result; the DNF is our ultimate failure in that regard. The feelings it can leave are probably worse than the pain during the event, but there are valid reasons for pulling the plug just like there are invalid ones (mostly quitting because it’s clear you won’t get the desired results).
I have one that haunts me still, er I should say, I have DNF that I still consider whenever I think about a true endurance race. I had completed a very difficult long MTB race two weeks prior, I had done ok just missing the podium by a few spots - while it was a great ride for me, I had podium envy watching friends place higher than me was very difficult. One friend in particular placed high, and had been riding much shorter than I; I put a lot of stock into that. So, I needed a chance to redeem myself. And so a short two weeks later I entered what was to be an even more grueling race. 2/3rds of the way through I gave up; it was an 80+ mile race on very challenging terrain. When I quit I couldn’t do basic things like ride over a log, I was cramping - at that moment continuing wasn’t worth it. Looking back (literally, I had to pedal backwards through the field to bail) I realized I should have stuck it out; but maybe not. What I saw was many fast and fit people struggling like me, but my chances at placing as high as my ego thought I should were dashed.
It took me quite a long time to recover from that event, I almost quit racing. It probably took months to recover physically but probably a year mentally. I discovered that performing well at 7-10 hour mountain bike races takes an amount of sacrifice I was unwilling to give; I never wanted to just ride these events, I was seeking competition at the pointy end but I didn’t have the gift, or willingness to train like a pro.
When I chilled out I started focusing on short course racing again. I could train effectively for these events and learned that I’d rather train for these as they were more enjoyable and exploited a relative strength of mine versus crazy endurance events. I found an outlet more suited to me and the actual riding I enjoyed. Not saying people need to change direction or disciplines but that failure stuck with me and in the long term I used it to help guide me to a much healthier relationship with racing bikes. I can go into events now (in better shape) with a better mental outlooks and reasonable goal. Finding some success with shorter events helps me realize that even though endurance racing isn’t my strength, I can add them to my calendar and not sweat the results - I just don’t quit them now, results be dammed.