Part natural selection, part sexual selection, partly an epiphenomenon/spandrel. It depends on what it is you find beautiful. Being attracted to members (and attributes) of the opposite sex should be rather uncontroversially a product of both natural and sexual selection. Certain foods, landscapes and environments are also attractive for reasons I think owe to selection.
One way to think about this is to consider what you find the diametrically opposite of beautiful and attractive, which is ugly or repulsive. Those often has to do with things that are directly or indirectly bad for you: wounds and open sores, pus, excrement and other forms of waste. Possibly some developmental abnormalities.
There are more vague sense of beauty, like feeling a certain attraction, or you could say a pleasing feeling of satisfaction from comprehending an abstract mathematical or geometrical pattern.
There might be some weak influence of selection associated with getting a positive emotional response to comprehending an abstract pattern, be it simply seeing a geometric arrangement of shapes or colours, or wrapping your mind around a systematic pattern of interactions among many smaller parts (I certainly do some times find pleasure in figuring out how something works, and would consider some processes beautiful). Realizing how something works can be literally exciting.
With respect to the latter part I think there’s a decent case to be made for natural selection contributing to such a sense finding beauty in certain processes. Understanding a complex natural process (like the relationship between climate and weather, and the abundance and locations of sources of food and shelter) can help you survive and reproduce.
Of course there’s rarely any product of selection that does not also have unselected byproducts. Experiencing itches and pains in so-called “phantom limbs” comes to mind as an example. I can’t think of a good reason why that would be selected for, nor even why a putative creator would create anyone with a tendency to some times feel an itch in a limb that was amputated 20 years ago. So here it should be rather uncontroversial to state that spandrels are a real thing, even if you are a creationist.
In the same way, some attractions to beautiful things are entirely plausible spandrels. I don’t think anything evolved under selection to find satellite pictures of hurricanes beautiful. So that’s definitely a spandrel.