Loki liked being in a cage.
Being in a cage meant that they knew he was dangerous. That he was to be feared. That he was worthy of being considered a threat. If he were not a threat, he would not be in a cage. Being in a cage meant that they were recognizing the extent of his powers, as no one had ever recognized him before.
All those years, he'd only ever wanted to be noticed. He'd wanted to be acknowledged as Thor's equal. Instead, he was ridiculed and ignored, treated as though using magic and intellect made him less than Thor, he who knew only how to use brute force like an animal. Loki was nothing but an unimportant blur hiding in the shade of his great older brother.
When he used his magic for innocent purposes, Loki was treated as a joke. No one understood. No one was ever rightfully impressed. No one ever gave him the credit he deserved for his diligent studies and stunning abilities with magic.
He tried to show them the way that he could transform wine into flowers.
He tried to show them the way that he could snap his fingers and call fire into being out of thin air.
He tried to show them the way that he could project phantom images of himself.
Time and time again he tried to show them the difficult pieces of magic that he'd mastered through weeks and months of study and practice.
But no one ever cared.
They brushed him aside, "Yes, that's cute, Loki", and went to go watch Mjolnir return to Thor's hand like a boomerang, as if that required any special skills.
They only paid attention when Loki made a mess. When he used his magic to stir up trouble, create chaos, then they noticed. Then he was recognized, finally. It was a lesson he learned slowly, over the years.
He just wanted to be seen as Thor's equal.
After enough years had passed, he decided that it didn't matter how. Clearly no one could ever see him as being as "good" as Thor. But there was still another way that Loki could match him…
Thor pitied him, being stuck in a cage, his freedom taken away. Loki knew that. But Loki only smiled. He liked being in a cage. Loki had always been "free"—but freedom was a lie. Where was the good in "freedom" when it was still impossible for Loki to be noticed for his own talents and hard work? When all it got him was a lack of proper appreciation and a permanent spot in the darkness of Thor's shadow?
So he didn't mind that being caged took away his freedom.
At least there the lights burned bright upon him.