I think CW knew they were going to get a divorce. He loved the girls, but in an unhealthy way. His whole identity was wrapped up in being a father. We don't yet know what caused his emotional separation from SW, or when it began, but there was evidence of it while SW was in NC. SW could see it coming.
I think CW knew that their world was about to come crashing down---they were going to lose the house (IMO). An ugly custody battle was about to commence that he probably knew he would lose, and he wanted to spare the girls all of that. Or he felt helpless because he didn't have the resources to fight it but she did.
So I think this is a case of "if I can't have them, then you can't have them, either." And "I love them so much that I can't bear to be separated from them." His attitude toward SW might have been the very same (even though he had been cheating)--I love SW so much that I can't bear the thought of losing her.
So he killed them. Grief and the prospect of permanent unbearable loss fuels rage sometimes.
I would be very interested to know if his parents were divorced when he was young, and whether there was a bitterly contested custody case where one parent did not let the other parent see the children.
ETA: I am surprised, if the above is correct, that he didn't kill himself, too.