Breaking the glass is incorporated into the wedding to remind us, right in the middle of such a happy moment, that the Temple has not yet been rebuilt. The glass reminds us that without the Temple we do not really appreciate what true joy is.
By the way, some people have suggested that the reason the groom breaks a glass is because it is the last time that he will put his foot down!