Kiritsugu Emiya decided to save the world instead of resurrecting his wife and daughter, so why didn't it happen?
because he didn't actually make a wish.
Kiritsugu's wish all along was to save the world, however while "inside" the grail Angra Mainyu showed to him and no matter the wish it would lead to destruction (and in a sense, exactly how Counter Guardians work which is what Shirou would end up becoming if he followed Kiritsugu's ideal of being a Hero)
Following this, Kiritusgu used his Command Spells to order Saber to destroy the Lesser Grail against her will. this prevents the Greater Grail from uysing it's sorted energy which is why the 5th war took place 10 years later as opposed to 60 which was supposed to be the norm
The Great Grail requires sixty years in order to amass enough mana to summon Servants, making the planning period span over generations. If the Grail is unable to utilize its energy, that which is leftover can reduce the time to as little as a decade, such as in the case of the period between the Fourth and Fifth Wars.
Fuyuki Holy Grail War > Procedure (1st Paragraph)
also to explain some things you mentioned in your question
why was Kirei Kotomine, Gilgamesh, Kariya Matou and Aoi Tohsaka revived?
Kariya Matou was never revived. Aoi Tohsaka wasn't revived because she was never killed during the war, her death seem to come after it.
She survives the war, but is confined to a wheelchair and suffers from brain damage, not understanding that Tokiomi is dead and Sakura is gone. Rin takes care of her mother, but feels lonely as her mother's condition leaves her isolated. Aoi appears to have died before the events of Fate/stay night, leaving Kotomine as Rin's sole guardian.
Source: Aoi Tohsaka > Role > Fate/Zero (3rd Paragraph)
Kotomine and Gilgamesh survived because they were both washed over with the Black Mud that spilled from the Grail. Kotomine got a Black Heart and Gilgamesh got a flash body (as Servants aren't actually flesh and blood)
Kiritsugu's Saber obliterates the Holy Grail, allowing its tainted water to soak Kirei's lifeless body, resurrecting him with an artificial, black heart. Kirei wakes up and finds Gilgamesh near him. He seems to have gained a flesh body from something that flowed to his body through the Master and Servant connection.
Source: Kirei Kotomine > Role > Fate/Zero (10th Paragraph)
Kiritsugu Emiya decided to save the world instead of resurrecting his wife and daughter
Ilya was never dead and Iris's "death" was by design (due to her being the Lesser Grail). their "death" in Fate/Zero was actually an illusion as at the end of the war what Kiritusgu saw as Ilya and Iris were actually projections that Angra Mainyu created to communicate with Kiritsugu (like the Radio explaining the Passenger Survival Scenario). Kiritsugu killed them because he knew they weren't real and was rejecting Angra Mainyu