I used to write a lot of fanfiction when I was younger. This is something that I admit to with more than a little embarassment. It is widely thought that writing fanfiction is one of the nerdiest things that you can do, and frankly, I don't disagree. It is also the case that most fanfiction is really, really terrible. A quick Google search will confirm as much.
With that being said, I don't think my experiences with fanfiction were a waste of time, because they were a perfect opportunity for me to practice my writing, and hopefully to improve it, too. The way I see it, fanfiction provides a lot of little crutches that can be very helpful to a writer-in-training.
1.) Many of the details of the fictional world and its characters are already established. The writer can skip a lot of fatigue-inducing exposition and instead move right into the meat of the story.
2.) Since fanfiction is based on existant works, there are certain "rules" already in place as to how the fictional world operates. Fanfiction is a playground, but it's a structured one. Having a structure enforced upon the apprentice writer (even if only loosely) can provide good lessons, as well as a good challenge and a healthy dose of plain old fun.
3.) Regardless of what work fanfiction is based on, that work is bound to have an online community of fans. These fans, or at least a portion of them, are a built-in audience for fan works. This is great, because it allows writers to get immediate feedback on their work from other people who love the source material just as much as the writer does. On the flipside, this can also mean exposure to critics, including very harsh ones, and this is important, too. Writers need to develop a thick skin, because even the most brilliant writers encounter people who just don't care for their work.
A lot of people consider fanfiction a total waste, both to create and to read. To that I say... well, maybe, but sometimes, maybe not. I don't regret my time spent writing fanfiction. Even if nobody reads it, and even if I look back on some of it and cringe, all of it helped me to hone my craft. There's never anything to regret in that. And besides, once in a while I will encounter a piece of fanfiction that really captured the spirit of the source material, or took it in a thrilling new direction that didn't seem to "break the rules" too much. And since when is a good read ever a waste of tme?