Gandhi came too late to have any influence on this.
The British rulers of India believed in inherent racial differences. There existed a lot of scholarly and popular obsession around classifying ethnologies and attributing characteristics to them.
From the wikipedia article on the "Martial Races" theory
The doctrine of 'martial races' postulated that the qualities that make a useful soldier are inherited and that most Indians, with the exception of the specified groups, did not have the requisite traits that would make them warriors.
The British recruited heavily from the 'martial races' for service in the colonial army. Sensing the inequalities and fierce loyalty to one's tribe or group of the diverse native peoples of the subcontinent, the British found opportunities to use it to their own great advantage. These already wide divides were a fertile breeding ground to inculcate pride in one's identity based on 'race'. This also forwarded the Divide and Rule Policy of the British.
The rebellion of 1857 was another factor. The Bengal troopers who first revolted were recruits drawn from the martial stock of Bhumihars(my stock, incidentally) and Rajputs of Bihar and eastern Uttar Pradesh. However, the loyal Pashtuns, Punjabis, Gurkhas, Kumaoni and Garhwalis did not join the mutiny, and fought on the side of the British Army and helped to suppress the rebellion. This reinforced the British policy of recruitment.
The British regarded the 'martial races' as valiant and strong but also intellectually inferior, lacking the initiative or leadership qualities to command large military formations. They were also regarded as politically subservient or docile to authority. For these reasons, the martial races theory did not lead to officers being recruited from them; recruitment was based on social class and loyalty to the British Raj. Winston Churchill was reportedly concerned that the theory was abandoned during the war and wrote to the Commander-in-Chief, India that he must "rely as much as possible on the martial races".
Upon its inception, the Indian Army inherited the British Indian Army's organisational structure, which continues to the present. Like its predecessor, an Indian infantry regiment's responsibility is not to undertake field operations but to provide battalions and well trained personnel to the field formations, as such it is common to find battalions of the same regiment spread across several brigades, divisions, corps, commands, and even theatres.
Like its British and commonwealth counterparts troops enlisted within the regiment are immensely loyal and take great pride in the regiment to which they are assigned and generally spend their entire career within the regiment.
All of the regiments classified erstwhile as 'martial' exist to date. And except The Gurkha, and the Sikhs, no ethnic or, religious preference is excercised in recruitment to any of them. Special mention must be made of the raising of the Gurkha Rifles.
This is an interesting interview.