Franz Kafka said, "Don’t bend; don’t water it down; don’t try to make it logical; don’t edit your own soul according to the fashion. Rather, follow your most intense obsessions mercilessly."
As writers, that is exactly what we do!
I don't know if this has ever happened to you, but when I get an idea for a story in my head, it's all that I can think about. It's like a thread on an old sweater that you can't help but pulling on. The more you pull on it, the more it unravels. In this case, pulling on the thread helps to unravel the story, and it slowly lays itself out in front of you.
It's a truly amazing thing, but it's definitely an obsession. I believe that all of us writers have some obsessive tendencies, because that's really the only way that you can sit down and write a story over the course of days, weeks, and months.
When I'm writing a new story, I often spend every waking minute thinking about the next plot twist and turn, the next chapter in the character's life, or the ending to the particular story I'm writing. Over and over again it goes through my head until one day I've discovered how the story ends. I've got the thing laid out in my head or on paper, and only then can I sit down and start writing.
Then, as I write the story, new things come to me. I go back and change the story to reflect the new direction it is going, and slowly the story continues to morph. Whether I'm lying in bed trying to sleep, sitting at the breakfast table, or running at the gym, there's always some part of my mind mulling over my latest obsession.
But that's the amazing thing of being a writer! As a writer, you can follow your obsessions and actually see where they lead you.
If you're obsessed with stealing other people's things (kleptomaniac), you get to jail. The same is true of obsession with fire (pyromaniac) and almost all of the other obsessions common today. It's a good thing that there's no "writing-maniac", or millions of us around the world would be diagnosed with the disorder!
A writing obsession can be a very healthy thing if indulged properly. As a writer, following your obsession can lead to that magnum opus, that work of literary art that you can be supremely proud of. It takes work, but letting your obsession take you away and following them mercilessly is the key to finding contentment with your life.