Because it reflects badly on sensei if they are putting their students up for testing when they aren't ready. When sensei allows a student to attempt a test, (s)he is essentially saying "I think this person is good enough to pass this test". If that turns out not to be the case, then it is embarrassing for everyone. I'm not saying people should pass regardless of how bad they are. I'm saying that people shouldn't be allowed to attempt the test if they are not good enough.
But as already has been mentioned, nobody sees it like that in other walks of life, schools etc.
What you and many others are describing is the culture in some parts of the aikido world. Not the whole. I know someone who went to train in Japan for a couple of months, and took shodan there. In their home dojo, hardly anyone is ever failed at a test. In these Japanese dojos - a system of dojos with many teachers collected under one shihan - typically 1/3 of all students testing for shodan are failed. They was a bit shocked to find out.
IMHO it is logical to make sure the actual testing is done before the "test" when the dojo is small, so the teacher can oversee each student throughout the training process. When the person testing don't regularly train with the examinator, it makes more sense to let the test be the actual test. It also a test of the other teachers in the organisation. In failing students testing for shodan and in each case explaining why, the shihan informs the teachers what they should focus on more.
Failing 5% of students or less sounds like the harsh way for the students. If regularly 1/3 of students are failed, it is of course a disappointment but not that a big deal.