Not all writers want to be published. Everyone is entitled to their path, so I support anyone who decides to keep their work private. Others desperately want to be published. I can understand that too. All writers are driven by an inner need to create though, and therein lies a delicate balance.
While being published doesn't make a writer's work good or better, it provides feedback that can help a writer hone his/her craft. Handing out stories to friends is usually good for ego strokes but little else. Friends either don't have the ability to do a useful critique, or they don't want to. Who can blame them? Too many of us on writer's lists have been burned by a diva reaction, so we sympathize with those who don't want to open themselves up to it. And man, do we ever regret those hours we spent pouring over the work of someone who demanded honest critique and then went apeshit when they got it. At least we don't have to see the diva every day after the tantrum. Real life friends aren't so lucky.
Online friends met in writer's groups are different. You can live in a tiny town, but the internet allows you to meet people from everywhere who share your writing interests. I live in LA, a metro area of at least 10 million souls, and even I have a hard time finding other writers. Online, I've met several hundred. In a writer's group, you can find people who are able to give good critiques (and bad). Even better, they're willing to. Workshopping stories through a writer's group is a great way to get feedback needed to hone your craft. But even that has limits.
Which brings us to publishing. Most publishers have a passion for books, but it is a business. So they have an obligation to find quality work that people want to read. They aren't completely objective, but when the product is art, who can be? But they are the most objective judges of writing out there. So submitting to them is a test of your craft.
I believe that there are many writers who want to be published because it fulfills a dream, but part of that dream is recognition that the writer has honed his/her craft. It's a milestone, and the best measure of a writer's skill.
All of that rambling leads me to this point. For writers who use publication as a test of their craft, there's an uneasy balance between writing with an eye to publication and the desire to follow a creative path. I used to only write stories when I felt the artistic urge. Quirky and experimental, those stories were truly works of creative inspiration. Now I find myself writing more often to calls for submissions. The calls are the starting point for, yes, creative work, but the impetus is outside of me. These stories written for calls, for the most part, get published, and I celebrate every acceptance, but that doesn't change their origins. I miss the time when all my stories came from ideas that sprang to mind of their own accord.
I still occasionally get a mad idea and run with it. Those are the stories I love most. But they hardly ever fit anywhere, unless I take broadly interpret a call for submissions almost to the point of willfully misunderstanding it. Sometimes the risk pays off, sometimes it doesn't. Those stories can sit unpublished for years. I take them out and tinker with them when I get a chance. As time passes, my craft improves, and I like to keep those stories as polished as I can just in case the elusive perfect fit call for submissions is posted. It has happened. A story I've been working on for at least three years went out today. It was time to let that one go. But what if I never found a fit? Does it make that story less worthy because it's never been published? And are the stories that I write to specific calls lesser works because they were crafted solely with intent to publish? I don't think so, but it is a delicate balance between the creative and commercial goals I've set for myself.