Multiple characters for the same sound in Chinese
Firstly, you need to know that the phonetic system of Ancient Chinese is far more complicated than today. Generally, the number of syllables in Chinese decrease over the time.
According to Wikipedia, Ancient Chinese have about 70 initials (including consonants and clustered consonants) and dozens of rhymes (including vowels and vowel combinations), which could resemble thousands (or tens of thousands of) syllables.
In Middle Chinese, clustered consonants disappeared, and some similar finals were merged. This could reduce about a half of the total syllables. There were 36 initials and about 40 finals.
In early 14th Century, there were only 25 initials and 19 finals (excluding mediums), much less than about 800 years ago.
The last big merge happened in the early 20th Century, called "Jian-tuan Merge", or loosely "Alveolar-Palatal Merge". Jianyin ("sharp sounds", like [ts], [s]) merged with Tuanyin ("round sounds", like [tɕ], [ɕ]). For example,  姓(sìng, "surname") merged with 幸(xìng, "luck/happiness"). (Example: 你幸福吗？(Are you happy?) /我姓“曾”。(My surname is Zeng. ) )
Therefore, modern Chinese only have about 400 syllables (according to Kahlgren, see Clock by Liang Shiqiu. In this article, Liang criticised superstitions related to characters with the same sound). 

EDIT: Someone talked about the quantity and frequency of Chinese characters. I'd like to add a point. In Modern Chinese, words with two or more characters are used instead of one character. However, in ancient times, a character usually IS a word. For example, "驹" means "young horse", while in Modern Chinese, "小马"("small horse") is used more often. To express increasing things and concepts in the world, the Ancient Chinese people just invent more characters to express them. Take horse as an example, each of the following character indicate one specific kind of horse:
驽 (bad horse)
骁 (strong horse, now rarely used directly)
骄 (horse that's about six feet tall, now this character means "proud")
骐 (horse with black patterns, usually good at racing)
骢 (horse with green and white skin)
骃 (horse with dark grey skin and white patch)
However, in Modern Chinese, when indicating horses, we just add adjectives before "马"(horse), like 白马 (white horse), 好马 (good horse, or horse good at racing).