Why is magic an art and what does magic mean to you?
In aesthetics, or the philosophy of art, there is no generally agreed-upon definition of "art". Most definitions that have been attempted either exclude too much or include too much. For example, if a definition includes the idea of the application of physical craft, like painting or sculpting, then that excludes "found art", and possibly excludes architecture, as the physical object that's produced is not generally created by the architect's hand. I have devised my own definition for art, which seems to include everything we'd like to be included and exclude everything else. As I say, though, this is my own definition, so is not intended to be presented as the final word on the subject if you can think of flaws with it, or of a better definition. My definition for art is:
"Art is an act of imagination designed to inspire other acts of imagination."
On that basis, magic certainly qualifies as art. A performance of magic requires imagination on the part of the performer, and it is certainly intended to inspire the imagination of the audience. Whether it always succeeds or not is a different question, as I don't believe that the definition of art needs to encompass an exclusion for "bad" or "failed" art. An attempt at art is still art, otherwise critical consensus would always be the final arbiter and we would be left in the position where Van Gogh's work was not art when he painted it (as critical consensus did not appreciate it), but became art after his death (when the critical consensus changed), which seems to unnecessarily complicate matters.