This particular line in Kipling's poem helps to bring out the notion of developing character within the individual. The ability to "walk with kings" refers to the idea of being able to achieve the highest of nobility and prestige. The sense of dignity in the image of being able to "walk with kings" is undeniably present. At the same time, the notion of not losing "the common touch" helps to highlight that individuals cannot operate outside of their own reality. The heterogeneous state of being in which all individuals live and reside demands that individuals are able to differentiate their abilities and skill sets so that they can work in both realms with equal fluidity.
As you probably know, this poem is all about what someone (the speaker's son, presumably) must do in order to become a man. The line you cite gives two of the things the son must do.
The son must be able to mix with anyone. He must think that he is good enough to "walk with kings" and he must act in a way that will make high status people like kings respect him.
But, at the same time, he must not get stuck up. He must not "lose the common touch."
So what the speaker is saying is that, to be a "man" you need to be proud and self-confident, but you need to still be humble at the same time.