The merchant kept the parrot in a cage of gold because he loved the bird very much and it was his most precious pet.
The story tells us in its very first line that he was “a rich merchant”. A rich man can afford gold. He used that gold for his parrot because he wanted everyone to see how much the bird was worth to him.
We know how strong his feeling was from his own words later: “You are very dear to me and I cannot bear to let you go away.” A cage of gold was his way of saying that.