Think about when you first started learning to program: write code, attempt to compile, FAIL, make some adjustments, FAIL again, make more adjustments, successful compile. Execute, FAIL, make more adjustments, etc. This rapid failure/remediation cycle is somewhat unique, as it opens us to try new and innovative things without fear of failure: failing is just part of the learning process. Since failure is "cheap", we tend to gravitate to sucking up all information about failures, in the hopes of learning from it.
Now think about most other trades: cooking/carpentry/plumbing/etc. When you fail, there are material losses. So that learning curve is expensive, and you often apprentice and learn from someone doing it correct, rather than trial and error (though you get a bit of both for sure).
I suspect this is the same reason when really interesting Post-Mortems are posted, they shoot up, and lots of positive commentary around them. We all consume it, in hopes they prevent us from writing the same one in the future.
Success stories usually won't include any dirty details, any shabby deals or the full naked truth of the events that underwent. No A-list actor will talk about the producer dick he sucked. You have a reputation to maintain after a success.
In a failure on the other hand, you probably are at the rock bottom, have nothing to lose, no one to be afraid of.
(As to why they upvote them, I'm guessing it's because often we learn more from failures than from successes, and usually you don't hear about the failures as much as the successes).