Android was created in October 2003 by Andy Rubin, before Google bought it in 2005
> "because they did not want Apple to win all the market"
Actual purpose was: "The early intentions of the company were to develop an advanced operating system for digital cameras, and this was the basis of its pitch to investors in April 2004. The company then decided that the market for cameras was not large enough for its goals, and by five months later it had diverted its efforts and was pitching Android as a handset operating system that would rival Symbian and Microsoft Windows Mobile."
You are right, Google did not intended Android to be a move against Apple from the start, this happened later after iPhone release.
I am also remembering about some emails between Steve Jobs and someone at Google but I can't find them, anyway Google is paying a ton of money to Apple to be set as default search engine, if Apple gets a bigger market share then Google will have to pay even more.