It should be remembered that the Indian Army poems come from the young Kipling, before his main public success, and the more jingoistic works from his later days as something of an Establishment figure.
Not the first nor last individual to become more conservative in his views with increasing age.