I can't understand why marukami dedicated 1/4 of his book explaining accident that happened to nakata and caused his stupidity!Was his past important?
Ah, you must be talking about Murakami's book called Kafka on the Shore! Even though that is not in the title of your question, the character of Nakata gave away the title! Please realize that even though the book's main character is Kafka Tamura, Nakata becomes a very important secondary character as well.
The plot of Nakata is a sub-plot of the book. Often called a "wilder narrative spiral" we learn of Nakata, why he is a simple elderly man, and that he never fully recovered from his involvement in the war. I wouldn't call it "stupidity" the the murders the stranger. It is more proof that Nakata is TOO simple. He speaks with cats (a cool skill) but he cannot read. The importance of all of this is Nakata becomes connected with the main character: Kafka Tamura. Nakata is drawn towards him, it is never quite resolved as to why. One of the mysteries of the novel, I suppose. Let's look at a piece of wisdom from this character:
In everybody’s life there’s a point of no return. And in a very few cases, a point where you can’t go forward anymore. And when we reach that point, all we can do is quietly accept the fact. That’s how we survive.
In conclusion, THAT is why a quarter of the book is spent explaining Nakata's past. It is also important to remember that part of the beauty of this book is that the elements of it are often not resolved (and are not SUPPOSED to be resolved). It is simply part of Murakami's style.