How to politely decline the university medal?
The problem is as @WetlabWalter says: the medal is not just for you - it is for everybody that supported you and, in fact, indirectly for your class, and lecturers. 

You have a good reason (for yourself) to decline it, which is commendable. 

But you might offend those who recommended you, those who taught you (who would be indirectly honoured) and possibly your classmates. 

If on weighing your principles against this you still stand by your decision to decline the prize, send a letter as long beforehand as you can, explaining your position and emphasise your history of declining prizes (to indicate that they are not the only one on the receiving end of the rejection). 

Don't decline on the event itself, this will be a major embarrassment.

Finally, if you develop a reputation for declining prizes, grant managers may decide that they'd rather not put glamourous, funded programs your way, so be prepared for limitations of funding in the future. For anybody as brilliant as a Grothendieck or Perelman, that should not be a problem, but if that's not the case, take that into account.

PostScriptum: The balance of prize distribution is very fine. A prize is supposed to honour the recipient. But if the recipient is absolutely outstanding, the recipient would add as much glamour to the prize as the other way around. Therefore, a rejection penalises also the prize-giver. 

Why are prizes at all relevant? You have a point in that a true scholar should not be motivated by prizes and honours. However, in today's very crowded fields, a prize is like a flag that demonstrates "this is how things should be done". It sets a signal of example for others. By rejecting the prize you send the message that you do not care to be an example; which is entirely your right - but you must be aware of that.

Interestingly, Sartre was one of the few people declining the Nobel prize (literature). It was claimed that, some years later, he decided that he'd rather be in need of the prize money and asked whether he could get it retrospectively (after this story, he couldn't). Whether this anecdote is true or false, it makes clear you have to think hard whether there could be a constellation whether you could regret your decision - it doesn't have to be for the money, of course.