Why did Niles still want Daphne after all those years?
This is a bit of a double standard in how men think but when a man has such passionate and intense desires for a woman and she ends up with somebody else that usually reduces those desires. Part of it is a coping mechanism I guess you need to move on. You cannot help fixating on what these people are doing together and that she is doing it with him and not you.
In Niles's case he had to deal with Daphne dating other men and then having an intimate relationship that resulted in an engagement and by then that would be it for most men.
On top of all that Niles had somebody for himself. An attractive woman he had much in common with and became married to. Between those 2 things there would not have been much heat left.