This poem expresses Kipling's view of manliness through a paean to deep friendship between two men.
The speaker says that only one man in a thousand is closer than a brother, and it is best to seek him out and find him before half your life is over. The other nine hundred and ninety nine men only have the opinion of you that the world does, but this Thousandth Man will be your friend even if the rest of the world is against you.
The rest of the nine hundred and ninety nine men are only interested in your looks or your glory or your power, but if you and the Thousandth Man come together then the rest of those men cease to matter – the Thousandth Man will "sink or swim / With you in any water".
The speaker says you can borrow money from the man and he can borrow from you freely; you can also talk and meet together for daily walks. The nine hundred and ninety nine are concerned only with gold and silver, but the Thousandth Man is priceless because you can be honest with him about your feelings.
No matter what the season, you can share your wrongs and rights. You can stand up against everyone else because the two of you support each other unequivocally. The other nine hundred and ninety nine men find it difficult to tolerate "shame or mocking or laughter", but the Thousandth Man will be by your side to the very end, even if it is at a "gallows-foot".
"The Thousandth Man" is a great example of a Kipling poem that deviates from his prevalent themes of imperialism, India, Orientalism, or war. In this poem he articulates an ideal friendship between two men as well as his views on what constitutes manhood. Manhood was a common subject for Kipling; this concern is also exemplified in "If-" and all of his war poems. A strict division between the genders existed in the late 19th/early 20th century; men and women were supposed to adhere to specific behaviors assigned to their gender.
Kipling suggests that men should have mutually fulfilling friendships with each other, particularly with those who meet certain intrinsic needs a man has. There may be many men that a man comes into contact with in the course of his life, but it is best to seek out the one man in a thousand that can actually spur him on to be the best version of himself and to stand up for him in all situations.
This man will stand up for you when no one else will; he will praise the character traits that truly matter and encourage their development, rather than be swayed by looks or glory; he will be free enough with you to lend you money; he will be easy to talk to; he will allow you to discuss your feelings; he will defend you against all others; he will even be there if you suffer some ignominious end, such as "the gallows-foot". This is a very thoughtful and inspiring depiction of an ideal male friendship, and even though it smacks of antiquated gender roles to some extent, it is the sort of friendship that even modern men may aspire to.
In regards to the aforementioned gender roles, amidst the discussion of the ideal friendship are indications of what Kipling and, frankly, most men of his era, believed to be perquisites of manliness. As can be gleaned from his war poems, a real man possesses a defensive spirit; that is, he will defend his honor or the honor of those unjustly wronged. He is to possess strength of character and understand that those deeds rather than his looks or his showy acts of glory are what truly matter. He is allowed to have "feelings", but only in a prescribed way. He is to scorn silly behavior and frivolity; he will uphold virtues of perseverance, stoicism, and loyalty.
There is little evidence regarding the possible subject of the poem, if indeed there is one. It is often grouped with what scholars call the Masonic poems, which includes "The Mother-Lodge" and "Banquet Night" which similarly convey themes of brotherhood. It does seem to express the ideals of the Freemasons and the intense loyalty they found in each other. It may thus not be about a specific individual but about the joys of friendship to be found within the Masonic community.