I've heard that he'd recently lost a job and a girlfriend. The two locations were places they would go together. He may have been looking for her, just lashing out, or both. So it's entirely possible that his primary motivations were not political.
Clearly, being mentally unstable can cause you to believe very weird things. When those weird things are even tacitly approved of by people, it's a lot easier to start believing them, and slide down that rabbit hole. Extremist politics is one of those kind of things.