Well I guess it could go both ways....
When Sheik is telling you about the sages he mentions the Shadow Temple first:
"One in a deep forest...
One on a high mountain...
One under a vast lake...
One within the house of the dead...
One inside a goddess of the sand..."
But thats assuming hes telling you the right order
Navi's promts also direct you to the Shadow Temple, but Saria tell you to go to the Spirit Temple.
A very interesting thing still exists and it is this; in the start Menu, the Medallion that shows up first in in fact the Spirit Medallion...suggesting that it is right to do first
It doesn't matter which one you choose first because although the items you obtain in the Shadow Temple (Hover Boots and the Lense of Truth) are helpful in completeing the Spirit Temple, they are not at all neccesary. I think, storywise, the Spirit Temple seems more fitting to be the final temple because it is more fulfilling and it is where Ganondorf emerged from.