We think that when someone "snaps" they simply go nuts on the spot. While that can be true, but not always.
Some people who have mental illness appear to be perfectly sane and rational. They can even function in society as the rest of us. He could have had a very slow descent into insanity which manifested itself so slowly no one noticed. As time went on, he began planning this and methodically prepared for it. (Every single accountant I've ever known is pathologically methodical when they do something.) It doesn't make any sense to us, but to a diseased mind, it could make perfect, logical sense.
People always look to a conspiracy to explain away the unthinkable like the Kennedy assassination or a mass shooting. Sometimes reality is the simplest answer. Like Charles Whitman, James Holmes, and Adam Lanza showed us, sometimes there is no reason whatsoever behind the actions of a crazy individual.
"If you will not fight for right when you can easily win without blood shed; if you will not fight when your victory is sure and not too costly; you may come to the moment when you will have to fight with all the odds against you and only a precarious chance of survival. There may even be a worse case. You may have to fight when there is no hope of victory, because it is better to perish than to live as slaves." - Sir Winston Churchill