I've done this, written towards an editor's taste, and it has resulted in sales. But at the same time, I use that taste as a kind of springboard to give me ideas; I'm not a natural writer of short stories (few are, I think) and having some idea of where the story's headed makes me more inclined to write a short story in the first place.
Here's a real-life example: I wrote a story for me, and sold it. Then I wrote a sequel, and sold it to the same editor; still writing for me, but knowing I had a good chance of selling it. Then for the next year's anthology, I tried something completely different both from what I knew of the editor's taste and from what had been previously published in that anthology. It didn't sell. The next submission I sent in was another sequel, in the same style as the two previous stories; still for me, since I wanted to know what happened next to those characters, but also striving to match the editor's taste. Won't find out for a while if it's sold or not. I'll find out in another month or two.
I don't think writing to an editor's taste is bad at all. I think it's sound marketing strategy. But one should get joy out of the writing as well, or what's the point?