@jerlands,
It is pretty clear why the Bible was written.
The Old Testament was written by men of a specific culture to support their cultural values and justify a Theocracy. The New Testament was mostly written by Saint Paul and people who agreed with him to promote their new religions, and fight what they saw as competing views (Gnostics and people who wanted to remain strict Jews).
The more interesting question is why it has become so influential in Western Civilization. I have answered that; the Bible is influential because it says whatever people want it to say.
You have a set of beliefs that fit your place in life, tell you that you are important, and make you feel good about yourself without having to worry about the uncomfortable parts of your life. You understand the Bible in a way that supports these beliefs... and so you like the Bible.
You see in the Bible exactly what you want to see, and so does everyone else. What is actually in the Bible doesn't matter. And that is why everyone says the Bible is important.