Having no actual rival in terms of power, knowledge, and spirit; that is to say, no one will actually attempt to openly claim they are better than you. To bring about the birth of a new era, to be admired and feared alike, and to have those that would suppress you acknowledge their defeat.
Whitebeard is not Pirate King because he is feared. There ARE those that love him, such as Ace and other members of his crew, but in the hearts of the people, he's nothing more than a dangerous threat. The same goes with the World Government. Based on the words of those that were around in Roger's time, Roger was a great man. A lot of people respected him because he gave hope for the future, for the dawning of a new age where people are free to live their dream of becoming great. Look at what happened to all the people alive during Roger's era: they've all accomplished great things. Clover discovered the True History. Saulo and Kuzan saw the light. Smoker did too, but in a different way. Kureha made a star pupil out of a young reindeer-man. Sengoku became Supreme Admiral of the Marines. Garp became a legendary, albeit outrageous marine vice-admiral. Dragon became the world's worst criminal. Shanks became an emperor among pirates. Whitebeard too. And so on and so forth.
Roger was a hero in the eyes of the people. He was a pirate, yes, but he was a pirate not bent on destruction on mayhem, but rather the breakway from convential means. He showed people that living your dreams and becoming great only takes motiviation and spirit. Anything else is secondary.
And that's what it takes to be a Pirate King.