Buddhist temple; mosque; government office (old)
Phonosemantic compound. 寸 represents the meaning and 之 represents the sound. Based on the original meaning "to hold", now written as 持. The current meaning "temple" is a phonetic loan.
《說文》:“寺,廷也,有法度者也。从寸,之聲。”
to hold