This quotation is pieced together from a larger quotation in Act V of William Shakespeare's Macbeth:
Macbeth himself says this after learning that Lady Macbeth has died (apparently she has killed herself out of guilt over urging Macbeth to kill the previous king, Duncan).
It appears to me that Macbeth is commenting on the futility of life. His reference to life being a shadow seems to suggest that he views life as empty and lacking in substance. Human beings are like actors in a play. They appear on the stage for a very brief time, but then vanish once the play is over. What's more, life is basically a joke (it is "Told by an idiot")--and not the funny "ha-ha" kind of joke--that has no meaning or value whatsoever.
Thus, in this quotation, we find Macbeth suggesting that life is essentially meaningless.