I've just rewatched the Enies Lobby arc and still don't understand how Spandam became the leader of CP9. Why didn't Lucci become the leader? He's the strongest member of CP9, but why Spandam is the leader? He can't even use Rokushiki.
It's not necessarily the strongest person who is the leader of a military group like this one. While I'm not aware of it being stated anywhere in particular why Spandam is the leader of CP9. There are some facts that can help us draw a conclusion.
Spandam's personality makes him the type of person that only cares about how he can get promoted. Often times, these are the people that get promoted due to the various schemes they are willing to do at other's expense.
From the One Piece Wikia on Spandam:
He is not detached from the idea of exploitation, backstabbing, or the use of loopholes to get his own way, as he has proven many times in the past.
While we don't know when CP9 was formed, we do know that Spandine, Spandam's father, was CP9's previous leader. His role in the organization could likely have put him in a position to recommend his son to receive this position.
From SBS Volume 54:
The majority of CP9 is made up of orphaned children who were left to the government, but I thought it would be interesting if they also had the children of CP9 members, kind of like thoroughbreds. Kumadori's mom is different.
Finally, the other members of CP9 were raised as assassins, to follow the government's orders. So it's natural to have someone above them that will watch over them.
While Oda doesn't specifically state how Spandam became the leader of CP9, I think that we can make some inferences
the Wikia stated that Spandam "relies on his natural talents of knowledge and deception, as opposed to actual combat."
he also is an ardent believer in "absolute justice," the form of justification that the World Government uses, and the Government itself. We have seen the coruptness of the One Piece world government, so it isn't unthinkable in how Spandam was able to either bribe or trick his way up there.
We can also see how the members of CP9 barely tolerate him, but they do, implying that we was placed there because of higher government positions.
And as for your point in Rob Lucci becoming the leader of CP 9 (post time-skip spoilers):
He actually does become the boss of Spandam after the time skip. They both are now in CP0. According to the Wikia, Lucci had tried killing Spandam after the latter called Marines upon CP9, but seems to have gotten over that disagreement.
Hope this helps, at least a little. Cheers.
UPDATE: OP requested for the source, here it is:http://onepiece.wikia.com/wiki/Spandam