What happened at the end of Fate/Zero? At the end of Fate/Zero, why did the Holy Grail materialize for Kiritsugu (Episode 24, 23:30) when Saber, Matou Kariya, Kotomine Kirei and Gilgamesh were still alive? 

Kirei should still have been alive because he was merely unconscious and watching Kiritsugu's visions within the Grail. According to what Kirei explained to Gilgamesh in order to "plead for his life" (Episode 17, 23:30), all seven servants must be "sacrificed" before the Grail can be activated.
At some point in the Fate/Stay Night game, it's revealed that the holy grail can be summoned without having sacrificed all of the necessary servants. The grail won't be all-powerful, but it should still be plenty powerful for most wishes. Because the grail was activated while some of the servants were still alive, it was not at full power, hence the destruction (the only wish it is able to grant in its current corrupted form) is less than what it could be.

Spoilers for F/SN game:


  The fact that the grail wasn't all-powerful and yet still caused so much destruction is why Kotomine sets in motion the events of the 5th grail war. By keeping Gilgamesh and beating the newly summoned servants, Kotomine would be able to see the grail at full power. In fact, six servants would be sufficient for any wish "within the limits of this world" (whatever that means), but Kotomine wants to know what would happen with all seven.


This is also important for at least one F/SN route:


   On the UBW good end, the grail is summoned while both Saber and Archer are present. The fact that Archer is still alive is not known at the time, even to Gilgamesh. In this case, the grail was summoned into an impure vessel as well, because Gilgamesh believes that the more corrupt the vessel, the greater the destruction it can bring.