Wheel spacers can be used to give your wheels a more flush appearance with the fender, also they can be used to increase your track width. Also they give you more options in selecting wheel offsets. Those kind of things.
Wheel spacers also play an important role in suspension geometry and brake caliper clearance. The hub and wheel are set in such a way that the weight of the car thrusts directly on the wheel bearings. If you change the rim and move the wheel a little bit one way or the other you change the angle of the load which can lead to premature bearing failure or even weird handling characteristics.