Even though some free-to-play games are optimized for the tiny percent of players who generate the revenue, other things in life are considered art, and are also optimized for revenue. For example, cinema/movies are considered works of art, because of the deep stories and emotions, and the the amazing visuals. They also are produced in order for the makers to produce money, yet they are still the often called the "seventh art." Video games are the same, they may have touching characters, awesome graphics, and a interesting storyline. If cinema is widely considered as an art form, how come video games are not an art form?
Another example of a widely considered art form is music. Music artists use powerful notes, unique chord combinations, and many more techniques to be considered art. However, music artists, like Billie Eilish, BTS, Shakira, Bad Bunny, and so many more all do this to make money. They simultaneously create music/art while also expressing themselves passionately.
Therefore, video games are art because even though they might be optimized for money, many other art forms do the exact same thing, and are still works or art that bring joy to many.