Most of you have heard me say this before, but I think the idea of many human behaviors as “by-products” of complex behavioral mechanisms selected for by something else is a powerful one. I associate the idea with Stephan J Gould (essay The Sandrels of San Marcos and the Panglossian Paradigm), but Richard Dawkins does an excellent job of applying the idea in The God Delusion as well.
Essentially, evolutionary pressures selected for cognitive and social skills, and their underlying neural mechanisms, that facilitated survival and reproduction in relatively direct ways. These systems, by their very complexity, by the inclusion of the capacity for abstract thought, and by other features, allow for the development of “metabehaviors,” patterns of behavior not directly related to survival and reproduction, such as art and religion. It is sometimes possible to construct arguments for how these behaviors might affect fitness (e.g. religion makes groups more cohesive, which then facilitates the spread of the behavior by modified group selection theory, or art is a form of display that advertising the wealth, and thus presumed reproductive fitness, of the patron, etc), but these hypotheses are hard to test and not, I think, strictly necessary. Unless a behavior is grossly maladaptive in the context of our current society, or is controlled by fairly simple genetic mechanisms that can be quickly selected against, it is possible for behaviors to endure which do not have much relationship to reproductive fitness.
A common misconception about evolution is that anything not perfectly adapted would have been selected out of a species long ago, so current traits must be adaptive in some way, if only we can find the right “just so story” to demonstrate it. But the current traits of any species reflect selective pressure that may no longer apply, as the environment has changed, and they represent the best available adaptation given the starting material, NOT the best possible strategy for adapting to the environment. And humans have changed our own selective conditions over the last 10,000 years or so far more rapidly than evolution is likley to be able to change our underlying physiology and behavior to accomodate. So not all our behaviors need be adaptive, and this includes the arts.