I write for myself, first. I'd toyed with writing something for a long, LONG time. Over a decade. I have barely-begun drafts for stories in two different genres, solid ideas for two fan-fiction stories (one a major property, one another SOL story), and I'd started a draft for a third story which I finally have taking shape in my mind, when a character got my attention and made me write 12,000 words or so in yet another genre. That one stuck.
I think once you're writing with publication in mind you have to write for your readers as well, at least to some extent. If I didn't want people to read and enjoy, I'd just plot it in my head and write notes. It'd be a lot faster! I know what I meant when I left words omitted and turned an awkward phrase or wrote a conversation in shorthand that would be gibberish. Writing is for me, maybe, but editing and rethinking and fixing issues is for the readers. For me, too - I want to produce something that's quality - but if I wasn't going to publish it I'd stop a few proofreading passes sooner, plus not waste the time of two editors.
On the other hand, if you're going with 'what people want' instead of the story you're telling, or you violate what your characters tell you should happen because readers might not like it, that's different. Not wrong, just different. Maybe you're writing potboilers. Perhaps I could sell 1,000 times the copies of something produced to fit audience demand - and perhaps I'd want to; it'd be nice to switch careers and be a professional author, if I could replace my income that way.
But, for SOL, for now? Writing the story I want to write, with awareness that I'd like other people to enjoy it too.