Designed to prevent damage to the core of the processor from installing the heatsink. True, the heatsink can be installed quite safely without a shim, but some people have a knack for crushing cores - that's what the shim is for.
Note though that shims do NOT help with cooling at all; they are only designed to prevent core damage by imperfect heatsink installation methods.