Ganondorf: an evil man an evil man determined to the rule the world. ( http://www.youtube.com/watch?v=uGcs6NO0dqg (see 1:00 - 3:15) As both child link and adult link he acts like a real jerk. At the beginning of the game, the king of Hyrule was convinced that he was a good guy, and loyal to Hyrule. Later in the game, it becomes evident he is evil. When link goes into the temple of time, Ganondorf receives the triforce of power, making him (obviously) quite powerful, giving him dark magical abilities and allowing him to destroy anyone who gets in his way of world domination.
The good people of Hyrule would not stand idly by as a dictator took over (with exception to people like Ingo, the Gerudo, and all of the temple bosses.) The soldiers that stood guard at the castle would perform their duties to protect the king and the princess from harm. Ganondorf, being the evil villain he was, wished to take over the world. His plan was originally to kill anyone who got in the way. However, it is a very dull existence to rule over a land with no minions. Therefore (long story short) he used his dark magic to turn the citizens of Hyrule into zombies, creatures who would not think twice about obeying an evil ruler, or about pesky heroes who try to enter the castle.