There is ostensibly a catch-22 among writers looking to make writing into a full-time career, and it goes something like this:
The only way my writing will be good is if I write about something passionate to me, but what may be passionate to me may be too artistic/smart/weird/literary/whatever for the market.
And it’s somewhat true. There are some writers I read, such as Gene Wolfe, that probably won’t ever gain a large commercial appeal, but who I believe is a far better writer than many of his contemporaries. Then you have Dan Brown and Stephanie Meyer who, while one would be hard-pressed to describe their contributions to writing as pushing any artistic boundaries, are extremely successful because they’re incredibly talented at giving people what they want to read. So where to fall?
I don’t think it has to be one way. One might not be commercially successful producing works they’re passionate about, but that’s no reason to attempt to maximize their commercial success. Don’t go against the grain; go with it.
For example, lets say I have two story ideas I’m equally passionate about. One is a story I know explores some esoteric issue most people don’t care about, but another deals with wide themes that many people can relate to. I want to write both, but guess which I write first? The latter.
I don’t think an artist should EVER sacrifice their integrity. Ever. But that doesn’t mean you can’t find something you’re passionate about that other people are too. I’d bet anything Dan Brown loves writing what he writes, but that doesn’t mean he isn’t capable of writing other things too. It’s not a black-and-white thing. Being an artist and writing shouldn’t be some angsty FUCK-IT-ALL quest; it should be about doing what you enjoy and getting paid for it.
Write what you’re passionate about, but if you have ideas you’re equally passionate about and one has more commercial appeal than another, why not go with that?