An interesting list from George Orwell.
(i) Sheer egoism. Desire to seem clever, to be talked about, to be remembered after death, to get your own back on the grown-ups who snubbed you in childhood, etc., etc. It is humbug to pretend this is not a motive, and a strong one. Writers share this characteristic with scientists, artists, politicians, lawyers, soldiers, successful businessmen — in short, with the whole top crust of humanity. The great mass of human beings are not acutely selfish. After the age of about thirty they almost abandon the sense of being individuals at all — and live chiefly for others, or are simply smothered under drudgery. But there is also the minority of gifted, willful people who are determined to live their own lives to the end, and writers belong in this class. Serious writers, I should say, are on the whole more vain and self-centered than journalists, though less interested in money.
(ii) Aesthetic enthusiasm. Perception of beauty in the external world, or, on the other hand, in words and their right arrangement. Pleasure in the impact of one sound on another, in the firmness of good prose or the rhythm of a good story. Desire to share an experience which one feels is valuable and ought not to be missed. The aesthetic motive is very feeble in a lot of writers, but even a pamphleteer or writer of textbooks will have pet words and phrases which appeal to him for non-utilitarian reasons; or he may feel strongly about typography, width of margins, etc. Above the level of a railway guide, no book is quite free from aesthetic considerations.
(iii) Historical impulse. Desire to see things as they are, to find out true facts and store them up for the use of posterity.
(iv) Political purpose. — Using the word ‘political’ in the widest possible sense. Desire to push the world in a certain direction, to alter other peoples’ idea of the kind of society that they should strive after. Once again, no book is genuinely free from political bias. The opinion that art should have nothing to do with politics is itself a political attitude.
None of those ring completely true for me. The second one comes close on my good days, but it doesn't do the job all by itself. Personally, I write because the stuff inside me needs to come out or else it will make my head explode. I write out of self-preservation.