Exams get a lot of flak from people. As a kid, I too hated exams. However, exams are one of the most simplest and convenient means to measure a person's intellect and aptitude. There are so many people in this world, so many students. How do we measure where each person stands? It is not possible to have a one on one session with everyone to see what they really know. Exams are one way of testing and quantifying knowledge on a level playing field.
Unfortunately, in places like India Exams have become predictable and it is not just knowledge but cramming and roting also gets good results. However, as I mentioned if you never assimilated knowledge career will never get really far. In fact many higher masters and PHD degrees focus on knowledge and involve many projects, papers, research etc where roting does not work. That is why many students find it difficult to cope in that environment as they never gave knowledge priority.
Although the practice of "judging" students over exam scores or parents "comparing" their children and adding undue pressure is wrong. Exams should be treated as benchmarks. When you don't do well it is not a sign of failure. It is an indication that something needs to be worked on and made better. We also need to realize not everyone will be great at everything. Each person will excel in different areas.