Sometimes there's a specific goal. This post, for example, is created to make progress on writing more regularly. I write a poem most years to go with my boss's Christmas gift. I write about major events so I'll have a record to refer to in the future.
Sometimes it's for entertainment. I can amuse myself for hours with just a pen and notebook. I do needlepoint to keep my hands busy while I watch TV. My most productive times are in the shower and in the car. I've often wished I had a telepathic PDA.
Sometimes other people inspire me. I get drawn into others' creative ideas, and often want to collaborate. My best work has been in shared world environments and in situations when I was bouncing ideas with someone on the same wavelength. It's difficult to get that much in tune with someone else in the first place. I also have a couple of my friends - my little brother is one of them, actually - who inspire me and spark my creativity for my independent prjects just by talking about their own.
Mostly, though, it's just what's welling up inside me wanting to get out. All the dreadful angsty poetry (mercifully, that well seems to have run dry), the medley and variations I whistle at work, Amalya's Story and Meg Allen's as well -- I write, I make music, I create, because I can and I must.