I think this from the New York Times encapsulates the crime pretty well: 
"The heavily armed sniper who gunned down police officers in downtown Dallas, leaving five of them dead, specifically set out to kill as many white officers as he could, officials said Friday. He was a military veteran who had served in Afghanistan, and he kept an arsenal in his home that included bomb-making materials." Like the murderer in the Orlando massacre, this one was motivated by hatred for a specific group that he used as a scapegoat to justify his murderous actions. The psychology of mass murderers in some respects seems pretty straightforward. Fortunately, this man was only able to kill 5 people. I'm sure there's more where he came from.