Programming is *an* art because literally every human pursuit can be an art if done with enough skill and grace. However, programming cannot be appreciated *as* art, insofar as we are talking about programming in its pure form, and not married to other aesthetic pursuits like UX design, because programming occurs in a black box that no user will ever see.
(Again I am talking about programming in its pure form. UX design, video games obviously, etc. are artistic but not because of the programming aspect. Which is to say: to programs can be considered identical from a UX perspective if they achieve the same effect. So clearly the art is in the *design*, not in the *implementation*.)
Anyway I wasn't trying to offend all my programmer friends or anything but when you start talking programming for "artistic" reasons it means you're diverting your attention away from other things, like usability, security, safety, efficiency, things you *should* be optimizing for, things that have real ethical consequences on users, and that worries me a little haha.
Of course pure art doesn't exist and every artist has ethical considerations with respect to their work. But the more detached and abstract we make the practice (the rhetorical function of calling something "art" is to abstract it away from pure practical concerns) the farther away and less significant those ethical concerns seem. That's scary when what you're doing is engineering things for other people to use.