Many people take from things what they bring, others take a pieces out and call it a whole.
This is a case of stolen treasure, the owner was murdered and then the treasure was hidden. Now you can follow the story and it makes sense, doesn't it.
So in this occurred in his capacity as a ruler and he had to uphold the law.
I would like to say that the Prophet Muhammad (peace and blessings of God be upon him) lived in mud brick for his entire life.
He went for months having no food except dates and water, the dates here are the cheapest dates, not even them sometimes.
He had no inheritance left to his children, he used to sleep on the floor with a bed made from palm fibres.
He had sometimes two, other times one set of clothing, for most of his life. He was not interested in money, ever.
His house lacked even the most basic furniture, in fact he had some cushions for guests to sit on, that's it.
He had a cup that he fixed himself because he didn't have the money to afford a new one.
So you tell me, from all what I have posted here, does it look like he wanted money? It doesn't, does it and any reasonable minded person can see that. If you want to read about his life read the book that you can find in the link below.
He was once offered money and property if he stopped preaching Islam, he refused both.