"The [wedding] ceremony is over. But before we can all shout out mazel tov to the new couple and their families, we must intrude reality and memory for an instant. In the last of the seven blessings, we asked God to restore the sounds of joy and gladness, the sounds of bride and groom to Zion and Jerusalem. It has reminded us that the Temple was destroyed, that the world is not yet wholly redeemed, that our own happiness cannot be complete until Zion and Jerusalem are secure. As a symbol of that ancient shattering and the as-yet unredeemed world, a glass is wrapped in a napkin and placed on the floor where the groom shatters it with a well placed stomp.
"There. We have remembered and it is done! Now, our joy returns. Everyone calls out with full voice, 'Mazel tov! Mazel tov'!"
I have also heard that it signifies the "breaking away" from the parents' home, and the beginning of the establishment of the home of the bride and groom. However, in many Orthodox families the couple lives with one of the parental families until the groom completes his Torah studies. Or until secular education is completed and the couple can be self-supporting.
So there you have it: the reason for shattering the glass at a wedding.
Shalom