You have hit the meaning exactly. Lear says this as he & his daughter Cordelia are being led to prison. He has since realized that Regan and Goneril have lied to him and betrayed him, while Cordelia remained loyal. She is the only one who was honest with him, although her answer greatly enraged him at first.
Yet now he is almost looking forward to a simple life with Cordelia, where they can listen to court gossip and laugh at the foolishness of it all. Essentially, he is calling the others prisoners as well, although they may be unaware of it. A gilded butterfly would have unnecessary extravagance, and would also be unable to fly. Thus he and Cordelia will laugh at their pettiness and the fact that they are just as trapped. Here is the full quote:
"We two alone will sing like birds i' the cage…
…so we'll live,
And pray, and sing, and tell old tales, and laugh
At gilded butterflies, and hear poor rogues
Talk of court news; and we'll talk with them too,
Who loses and who wins; who's in, who's out;
And take upon 's the mystery of things,
As if we were God's spies…" --King Lear, Act V, Scene 3
On a side note, I find it interesting that this quote has suddenly found popularity on the body of Megan Fox. It seems rather ironic to me, as many would consider film stars the gilded butterflies of our society. Indeed, those that seek plastic surgery or outrageously expensive clothes to enhance their already natural beauty should think upon this quote.