This passage comes near the end of the play, at Macbeth's lowest point: he's murdered all his friends; the country's rebelling against his rule; he's surrounded by enemies; and now his wife has just killed herself out of guilt for her part in the murder of the king,
This speech is essentially Macbeth saying, "Life sucks, and none of this was worth it."
Ironically, he doesn't give up; after this speech he marches into battle still believing that while life might suck, he's still king and nobody can take that away from him. (Spoiler: they take that away from him.)
(By Raul Arias)