Put it up over your typewriter. Yes, it's unfair. Between two salable stories, one well written and one badly written, most editors would rather buy the one that is better written.
Editors reject stories for all kinds of reasons.
In order to sell a story it is not necessary to learn to write well. But a story may be good in all kinds of ways, excellently written, with warm, lovable characters and wonderful style, plus a philosophical outlook which would make you the new Mark Twain or Jane Austen, and it is still going to get rejected if it doesn't give the editor those few things the editor wants and needs. The editor knows it will give the reader a Satisfying Reading Experience of the kind his magazine was intended to provide. The story has a clear-cut, likable character with whom the reader can identify. The story tells, and solves, a clear-cut narrative problem which the main character solves by his or her own efforts.