I always figured that the ranking was based on a bunch of things like how much culture I developed, wonders, structures, pop, lack of disease and pollution, reaction of other civs - but it seems more random to me lately.
I would win and get a mediocre ranking, but recently I had a game where I was a war pig. I attacked at will and leveled cities and nations - all who stood in my way. "I built me a bomb and dropped it on every %$@#$%^ that got in my way".
And I got the second highest score - go figure.