Art is subjective, we each have our definitions and interpretations of what is and isn't considered art.
Mathematics and arts go hand in hand though. Painters and sculptors visualize shapes and size when they paint/sculpt and that's geometry. There would be no art without mathematics.
Coding itself is an art, putting all those strings of programming language into something people can enjoy, I think that is an art in itself. Not everyone can code and not everyone can code good.
Then again we can argue that art is supposed to be work and expression of one artist, video games are many people working together for an end product and usually the goal of the product is $. So I can see how you feel it's not art.
But we could compare it to architecture.
An architect, draws out a vision, makes a plan then foresees the workers building it. Of course this is on a different scale, but shit is comparable, the end product is made for profits but its also art to design and build a building. Different type of workers come together to bring the vision to life. Some architects express themselves with unique designs others just copy and paste whatever else has been done before.
So how can video games not be considered art ? A group of people pool in their talents and efforts into bringing a vision to life.
I feel that video games are works of art, but not all the works can be considered good.