Because it is an agreement that when the book is given to a human the shinigami must kill its user when the time comes. And because Kira was smart but not smart enough to outwit Near.
In a way i think he deserved to die because killing his own father and a few other innocent people.
But i do believe he was the true god of the world in the show. He stopped wars. Crime went down 80% and the world became almost peaceful