The reason Solomon needed to be wise was in order to build the temple. The Temple was the Old testament place of communication between God and man (as well as the place of sacrifice). God dwelt there - but it did not 'contain' Him. God 'put His name there' and Solomon prayed that the Temple would be a place that God would 'pay attention to' when the people sinned but then turned from their sin and prayed towards it. It was the place where heaven and earth got connected - a communication channel. The interesting thing is that Solomon's prayer in 1 Kings 8 prayed that God would listen and pay attention in a wide number of cases. The cases Solomon prayed about seemed to get progressively worse and worse and progressively further and further away from the temple in each case. in 8:31 it was to do with one man sinning against his neighbour but then coming to the temple. In 8:33 it referred to sin committed whilst far away from the temple on the field of battle. In 8:46 it referred to people being far away from the temple in another country in Exile on account of their sin. Each time God is asked to pay attention and forgive no matter how big the sin or how big the distance - when they turn and pray toward the Temple. Today there is no temple because it is now replaced and fulfilled by Jesus. Jesus is God's communication channel today. That channel (Jesus) will stay open to us even when we sin and even if we are far away - if we will turn from our sin, plead for mercy and look to Jesus. If we turn and look to Christ the door is always open.