In lieu of other responses:
"How important are rewards in education?"
Ok, rewards to who(m)?!? Parents, or the kids? A huge difference. And, also, significantly, what kind of rewards? Macho-points? Scholar-points? Good-citizen-points? Hm, we don't have "contests" for scholars or good citizens...
"Right from primary schools, all the way up to IMO, there is intense competition."
The human primates "understand" this. Especially males, etc. So, yes, on one hand, playing into this will riff on kids' impulses... on another hand, (I claim) this is almost entirely unrelated to mathematics (the thing-itself) and understanding it (which perhaps is related to education...)
So I do truly think that a great part of the tension/problem is the confounding of human-beings'-tendencies with the demands of understanding the subject.
"Students and teams are constantly being judged."
If you'll pardon me... "Whoa, ..." Teams? Judged? Sure, in contest scenarios, but ...
"... X scored 100%/A+ and is therefore better than Y. X derives pleasure from being at the top and this is a clear motivating factor for him to remain consistent."
If you'll pardon me, I think this is exactly an indicator of the thin-ness of the motivation toward scholarship and broader-benefit of mathematics. Doing sums faster is a very minor virtue. "Beating other people" accomplishes nothing at all.
"Are there any alternatives to the grading system? Is it sensible to completely do away with the grading system (I know this doesn't make a lot of sense, but still...)?"
Of course there are alternatives, but the question is about viability. In the U.S., and with variations in the EU, and in many other places, bureaucratic judgementalism gives huge credence to "objective" accomplishment (ooh, think "impact factor" for even grown-ups...) so we (humans...) are somewhat doomed to playing against this.
"Most of the students I see try to optimize for grades and not learning. Should the thirst for grades/marks be replaced by a desire for learning?"
Here is an even more over-layered presumptive question... "Should" desire for good grades "be replaced by" ... "desire for learning". Ahem. If we could mandate that... um, sure. But a kid (and every organism) is fundamentally rational, given the information that it has. The awkward truth about "education" is that kids are going through the obvious stunningly confusing/distracting issues about puberty, so will allocate only a tiny fraction of their attention to anything else. And, lest we be too disparaging of such a viewpoint, we should not that we'd not be here if our ancestors hadn't had a suffient impulse on a regular basis over the various millenia... (whew!)
Still, apart from all that sociological babble, ... I think that a useful answer in any particular person's context depends so hugely on that context that I have no answer...
(All this was just to explain the difficulty of an answer... lucky I don't have to make a living at this...)