I think that he mainly switched sides because he felt that Caesar's Commentarii gave to much glory to Caesar and not enough to himself. He also believed that he was at least Caesar's match as a general, if not his superior.
He thought that he would have had a better shot at glory with the Pompeians.