Dark thoughts were leading to dark actions.
He was running out of energy, the ability to cope with the fact that he had set himself to a standard that he couldn't possibly hope to meet. Was that it? No, that's what he told himself to make himself feel better. He was running out of energy, the ability to cope with the fact that he had set himself to a standard that he didn't want set for himself in the first place. And as a result had no drive to succeed. At anything.
When people are constantly doing something with there time they don't want to do, but have a sense of obligation to remain doing said thing. They look for more extreme measures to eliminate the thing that they don't want to do. Mostly so that it will look like it was out of their hands. Or, they will eliminate that which they feel obligated to.
In short, he wanted to quit his job, but before he did that, he had to kill his wife and boss.
He had to kill his wife and boss because they were the ones that knew about the standards he had accepted in to his life. They were the ones that knew because they were the ones that set them.
They didn't do it on purpose, and neither of them were bad people. They just wanted different things out of him that he wasn't willing to do. At least, not anymore.
It's hard to kill two people and get away with it. It would be slightly easier because they were having an affair.
Was that why he wanted to kill them? Was the rest just rationalizing the decision?
Probably, doesn't really matter.