Rashi explains that “.g” (tree) serves as a metaphor for an an honorable, righteous man who will protect the country by his merit.
This explanation seems peculiar, for if Moshe was inquiring as to the presence of a righteous honorable man, should he not have sent the spies searching in the houses of prayer and study? Why did he send them to the public thoroughfares of the city, and to the gardens and orchards? When a city has righteous and honorable rulers, it reflects their presence in all areas of the city proper. The influence of a great person is not bound by the four walls where he lives; it shines forth and permeates the community. Every individual member of the city is affected by the presence of this person. In our day those communities that maintain Yeshivos and Torah leaders in their region reflect a special spirituality in comparison to those which do not have the opportunity to maintain Torah centers. It was for this reason that Moshe sent the spies to search the cities, to find if they maintained and were influenced by such individuals who were able to save their communities.