This is what Eiji Aonuma said about Spirit Tracks:
"Why would an archenemy like the Phantom become your ally, we asked ourselves, and during that discussion we came up with the idea that one way would be if a second character took control of that Phantom for you. But who? We thought Zelda might be an interesting and appropriate character. So that's how we decided upon the story where Zelda is going to have her body taken away by an enemy. One of the most important facets of the story would be for Link to regain her body but, at the same time, her spirit form can take on the adventure together with Link."