Jim Butcher wrote Storm Front, the novel that launched The Dresden Files, as an assignment in a University of Oklahoma writing class taught by Deborah Chester.

The Direct Answer
As a writing class assignment meant to prove his teacher wrong.
It was his ninth attempt at a novel, and his teacher told him after reading two chapters that he'd be able to sell it.

The Bet

Butcher had spent a semester resisting Deborah Chester's teaching methods, convinced at twenty five that he already knew better. He decided to prove her wrong the fastest way he could think of: by doing exactly what she told him to do and writing the book she'd assigned, a hardboiled detective story crossed with wizards, using the structural rules she'd been teaching all along.

Chester read the first two chapters and told him she didn't know if it would be the first thing he sold, but that he would be able to sell it. The manuscript became Storm Front, published in 2000. It was Butcher's ninth attempt at a novel, not his first, and the eight unpublished attempts before it are part of why he's since been blunt about crediting craft over natural talent.

An Outline That Outlived the Class

Before Storm Front sold, Butcher had already plotted roughly twenty books' worth of the series, including specific stepping stones he wanted to hit, a stretch with Harry Dresden in prison, a stretch with no magic left to work with. He's said he still refers back to that original outline, which means a document written for a university course has quietly functioned as a series bible for more than two decades and eighteen novels.

For the daily schedule that produces the books built on that outline, and Butcher's broader philosophy on craft versus talent, see the complete Jim Butcher writing routine.

What You Can Steal