You shall make on its hem pomegranates of blue and purple and scarlet material, all around on its hem, and bells of gold between them all around: a golden bell and a pomegranate, a golden bell and a pomegranate, all around on the hem of the robe. It shall be on Aaron when he ministers; and its tinkling shall be heard when he enters and leaves the holy place before the Lord, so that he will not die (Exodus 28:33-35) .
I remember hearing in a message that these bells told the people on the outside that the high priest was still alive, that God had not struck him down for uncleanness or a breach of holy protocol. It was also explained that a rope was tied to the ankle of the high priest, such that if the bells stopped tinkling, suggesting that God may have struck down the high priest, the people could pull him out by way of the ropes without risking their own lives in entering the place from which they were restricted. I think I even told this legend myself when giving a message about Zecharias' ministry in the holy place, where he received Gabriel's announcement of the birth of John the Baptist. But after researching this, I have discovered that it is nothing more than a legend. There is no biblical support for it. Here's a good article discussing it on ChristianAnswers.net.
Now, back to the question of why the high priest wore bells. Now, he did not wear these bells into the Holiest Place ("Holy of holies"). It was only into the Holy Place, which was separated from the Holiest Place by a thick, multicolored veil. The priests were not restricted from the Holy Place, as they were from the Holiest Place, where only the High Priest could enter once a year on the Day of Atonement.
No explanation is given in the Scriptures for the bells except that they were designed to be heard when the high priest enters and leaves the holy place and that they were a necessary part of the priestly garment on risk of death in their absence or, perhaps, in their silence.
If I might conjecture, perhaps the active tinkling of the bells from beginning to end (i.e. entry to exit) would help keep the high priest alert to all the regulations with respect to his dress and duties in the holy place, where a failure at any point could mean his death. They would, then, serve like a modern-day string tied to the finger or an alarm clock or a cell phone notification beep or message.
Since the text does not give an object to the words "shall be heard," it might very well be that the intended hearer was the high priest himself. The sound, therefore, may not have been for the other priests or the people on the outside but for the high priest himself.
Why woud this be necessary? Well, we have examples of God's judging priests for being careless with His holy things, whether intentional (e.g. Nadab and Abihu in Leviticus 10:1-2) or uninentional (e.g. Uzzah in 2 Samuel 6:6-8). As God says,
Among those who approach me
I will be proved holy;
in the sight of all the people
I will be honored (Leviticus 10:3).