Earning a living as an artist is tough. Most won't get their work seen in a gallery, so they turn to commercial art or graphic design. Now they learn to create art for a client that fits a brief. They do this every day for years until they lose the ability to make art for themselves. I know this happens, because it happened to me.
Learning to code was the best career decision I ever made. I now make significantly more money than I did before, which enables me to fund my own art projects on the side. I'm learning to get back in touch with why I wanted to make art in the first place. Like it or not, we all need to earn a living. In my opinion, doing so in an art-adjacent field is not somehow morally better than doing so in tech.