The movie only had a few lines about who Krall was and it was somewhat difficult to follow. I had to piece things together after the movie before I realized what his actual motivation was. Frankly, its something non-fans would not understand as it delves heavily into Trek history.
I forgot what his human name was, but Krall was a human MACO Major who fought in both the Xindi War and the Romulan War. After the two wars, the UFP was created. The MACO forces, which was a branch of the Earth military, were disbanded and he was incorporated into the newly formed Starfleet as a Captain. As a decorated MACO officer, Krall was given the USS Franklin, the first warp 4/5 (?) capable starship of it's time.
The problem was, Krall is a soldier of war and not a starship Captain who runs around putting out fires and making peace. He quickly fell into the same rut Kirk was in at the start of the movie. Krall did not believe his mission of "exploring strange new worlds, discovering new life and new civilizations" was worth doing. He did not believe joining with the Vulcans, Andorians and Tellarites to form a Federation was a good idea. Since Krall is from Jonathan Archer's era, it is not too surprising that that he believes Humanity can stand it's own and does not need the other alien species, just like the Terra Prime faction believed in ENT.
And when he discovered this alien world, it's history, and it's technology, he decided to abandon Starfleet and set about planning the destruction of the Federation and returning Humanity to its central place in the universe. Now, I admit this is where things get a little fuzzy as to why he spent nearly 100 years plotting and planning while the Federation got larger and larger. Maybe the alien tech he was using to keep himself and his remaining 2 officers alive had turned them crazy. *shrugs* but that's what set up the chain of events in Star Trek Beyond.
In other words, Star Trek Beyond is the story of a Captain gone rogue. A Captain who believed Humanity-Only was the only route to go. And since Krall was once a Captain, it explained how he easily tapped into Starfleet frequencies, knew how to bypass the Enterprise's shields and take down the ship with ease.
I really loved that Kirk was in the same position Krall was in at the start of the movie, demotivated, unsure of why he was serving in Starfleet. I loved that it took the entire crew to piece together Krall's story and plan. Scotty and Jaylah who discovered the Franklin and it's archives, Uhura and Sulu who discovered Krall's plan of destroying the Federation, and especially Uhura's ears and linguistics training that gave them the final piece of the puzzle, that Krall was the Captain of the USS Franklin. And thru defeating Krall, Pine's Kirk now understands his purpose as Captain of the Enterprise. Kirk now understands that the activity of exploring strange new worlds, seeking new lives and new civilizations has a purpose. It strengthens the Federation as a whole, making it more united and stronger with each passing day.