Okay, my main question here is: Where did they come from?
I'm sure there are some answers throughout the games hinting at where some of them came from, and we know the Arbiter's Grounds used to be a prison if I'm not mistaken. But what about those that are actual temples? Focusing on just Ocarina of Time here, because it's easier to work with just one game, there's a Forest, Fire, Water, Spirit, and Shadow Temple. And that's ignoring the Temple of Time.
I would imagine that the name "Temple" was no accident. These could likely have been places of worship some time ago. The obvious one is the Spirit Temple, where the giant statue of a goddess sleeps in its deepest chambers.
Keep in mind as you read these little thoughts that it's been awhile since I've educated myself on some of these.
The Fire Temple could have been built by the Gorons to honor the Goron that defeated Volvagia with the Megaton Hammer. But it's so large that it must have had other purposes as well. Perhaps housing the Megaton Hammer was only secondary to its true purpose. Or maybe Volvagia used to be their peaceful protector and it was actually a shrine to him/her.
The Forest Temple has a very old mansion-like feel to it. It could have simply been the home of the Poe Sisters. But that leaves you wondering why they started calling it a temple.
The Water Temple is a tricky one. It seems to serve very little purpose to anything, until you consider the one room with the platforms moving up and down. Is the Water Temple some sort of ancient hydroelectric power plant? Skyward Sword already made it clear that there was a highly advanced ancient civilization that could build freaking robots, so I wouldn't put it past them. But I also suspect that the Water Temple used to originally be above ground.
The Spirit Temple, as I already said, was clearly an actual place of worship for the Gerudo. I wouldn't be surprised if the desert used to not be so vast and the Spirit Temple was a palace to the ruling powers of the Gerudo. I mean, Gerudo Fortress is rather makeshift when you really look at it.
The Shadow Temple...??? Seriously, I dunno. What the hell, Nintendo, you've stumped me. I mean that hellish boat ride... the giant bongo... the invisible walls... Could this have been a training grounds for the Sheikah? The Lens of Truth does indeed have their symbol on it, and this appears to be the most integral item used in this temple. That's really the only idea I can honestly come up for this.
I don't believe OoT's Temple of Time is the original. In fact, it's clearly not. It's probably the third or fourth one built. The one in Skyward Sword (oh wait, there were two) was already crumbling and in a state of disrepair by the time Link found it. Also, the presence of the Sages' seals (the medallions) in OoT's ToT indicates that this was a more recent building, as none of those existed before.
Like I said, this is all just looking at only OoT. You could probably point out how some of the dungeons throughout the series have similar themes but are in different locations. I'd say that they only moved because it's a video game series... They have to write the story and quests around the world they created, and it would be boring having to do the same levels and such through multiple games in a series.
These ideas have been bouncing around in my head at work lately... I get a lot of downtime. So I just wanted to share my thoughts. Add yours and criticize mine at will. And feel free to venture outside of Ocarina of Time's temples. I only did this to help focus my ideas better.