The sultans of Turkey were also the spiritual heads of the Muslims and were called the Caliphs. During WWI, the British harassed the ‘Caliph’ and Muslims across the world widely protested this.
In India, Muhammad Ali and Shaukath Ali, two brothers, started the Khilafath movement supporting Turkey in 1919.
Gandhi extended his support because he believed that the British would only withdraw if the Hindus and Muslims fought together.