What's the purpose of a bunker?
Seeing how they originally resulted from a blow-out or animals, I'd suggest that the purpose was to integrate natural hazards into design.
Eventually, we had 99.9% of courses without blow-outs or animal-created bunkers, so designers built them to mimic the original Scottish links.
In later years, we have what Redanman calls "bunker fetish", where they became eye candy. Whether it's eye candy, landscape architecture, or a "bunker fetish", we have today an attempt to bring a touch of links golf everywhere.