It certainly wasn't God's idea. He didn't want Israel to have a king and warned them lots of bad stuff would happen if they had one. But he gave them one anyway and while they are confiscating the treasure of enemies (spoils of war) and fellow-countrymen (taxes) they built opulent palaces for themselves. Then they felt bad living in luxury when God was in a tent so came up with the idea of a temple. God discouraged it, but they wanted to anyway. Did he permit it or just give them over to their own desires? Scripture doesn't say and we're left to wonder. But after it was built he did come and inhabit it with is glory. Why? It's hard to say what all that was about? Would unregenerate humanity not have taken him seriously if he didn't? Was he honoring Solomon's gift, faltering as it was? Again, we don't know. We only know that Jesus wanted it torn down when he got here.
It is very hard for us to imagine how God was making himself known in a shame-based society before the cross because we have no idea what that was like. The. Cross. Changed. Everything. Now we have access to God through a sympathetic high priest, they were drowning in their sin and shame. God was trying to keep them faithful as much as he could until Jesus could come. How much is God's desire in all of that and how much is his capitulating to broken humanity? I don't think we know, but it is interesting to contemplate.
But after Stephen declared that God does not live in buildings made with hands, we have no excuse indeed for building opulent buildings in his name. As much as a marvel at cathedrals and opulent religious buildings while I'm in them, they speak more of the corruption of humanity than the glory of God to me. I can marvel and be sad all at the same time at how much we can do in our own effort, and how far short it falls of what god really desires.