There's an old joke... What do you call the lowest scoring person to get their doctorate? Doctor.
Yes, ultimately you passed, whether by a lot or by a little. And for some people, like those who tell that joke, that's all that matters. Those people are right... But also wrong. Test scores are nice, but they aren't everything. You can do poorly on paper and do excellent in practice. The opposite can be true, as well.
However, you did something that wasn't measured on the test. Something much more important than the test itself. You applied yourself. And that's not something that can be taught. You learned more than they did. You worked harder than they did. Being promoted wasn't a reward for those things and being denied promotion isn't a punishment. Those are simply consequences.
The reward or punishment comes much later. It comes when you're faced with a situation where you need to apply your knowledge. You will be rewarded with success. They will be punished by failure.