JuicieJ
SHOW ME YA MOVES!
Lol it was a joke. He could not realize who he was actually fighting until the end. Maybe like a magical disguise or something. Or maybe Ganondorf could cast a spell on Link that made him think that who he was fighting was evil. Maybe he thought that he was fighting Ganondorf until he killed Zelda and the spell was broken. So essentially Link was Ganondorf's pawn the entire game.
That would be a really good plot device and would be a nice change of pace from the typical Zelda story. I like it. (So long as Zelda didn't stay dead and the villain wasn't Ganny.)