That can end up being just as time consuming as doing the research to begin with. Often there is no time and no money to go back and do that. If your 'budget' is 6 month you're going to spend 6 month trying to get your experiment to work. You're not going to 'give up' after 4 month and spend 2 month putting together a "why we failed" paper.
For example, I imagine that archeological work is extremely high impact if excavation efforts led to discovery of ancient city.
Archeology paper would probably be less interesting if the paper said “we dug this area, found nothing”.
If one were to judge those two papers, obviously the discovery paper is higher impact than the negative result.
Not as valuable as a discovery, but very far off zero value. Yet the reward in academia would be near-zero.
So after a certain time spent, you are left with a choice of ‘massaging’ the data to get some results, or not and getting left behind those that do or were luckier in their research.