Breaking a cup in a marriage ceremony was originally cited in the Talmud, and the reason given is that we should limit our joy and laughter in this world, presumably until Messiah comes.
Nevertheless, the Talmud attaches importance to the cup’s shape and value. The Talmud describes breaking very valuable glass cups, which is not commonly done nowadays. Nevertheless, breaking a very expensive cup is liable to be a little depressing!
Hundreds of years later, though, it became customary to pour wine out of the cup before breaking it, and there was less emphasis on the cup’s value or shape.
In fact, it was not until the thirteenth century that the reason for breaking a cup at a wedding ceremony was attributed to keeping the destruction of the Temple in mind. The Remah cites a custom to either break a cup or adorn the groom with signs of mourning to remind us to mourn for Jerusalem.
For this reason, it is often customary nowadays to put some ash on the groom’s head before leading him to the Chuppah. This custom is also mentioned in the Talmud.
In the 15th century, it was customary in Germany for the Rabbi to give the bride and groom wine to drink from the cup, after which the groom would throw the cup at a northern wall so that it would break. They would then rush the groom into the wedding hall before the bride got there.
This was done to protect them both from evil influences. The northern wall was chosen because that is where evil influences emanate from, and our enemies also broke through from the northern side of Jerusalem 2000 years ago.
Other sources give a different reason for our breaking a cup at a wedding ceremony, to ward off the Evil Eye from the bride and groom. If evil things have been decreed for the bride and Groom, let it be realized through breaking this cup. Alternatively, since there are usually many people at a wedding, there may be an Evil Eye present, so let it go to breaking a cup instead.
By the sixteenth century, it became widely accepted to break a cup to keep the Temple’s destruction in mind, even though the original reason had been entirely different.
That being the current mindset, why do people shout, “Mazeltov!” when the cup is broken? Rabbi Uzziel, an Israeli Chief Rabbi, was against wishing Mazeltov at this point, (as the whole point of breaking a cup is to keep the Temple’s destruction in mind, not to rejoice more), but he couldn’t stop it, and it is still customary to do this nowadays.