I believe Gandhi was made into a hero by the british. He wasn’t all that he’s made up to be.
British wanted to walk away from India. They had sucked out enough wealth, had not much more to earn here. It was immensely expensive for them to run this country- as they had to provide all the governance, trains, post etc.. for the huge size of the country and population. They were worn from two world wars and apart from military strength in numbers, India was getting to be a burden rather than a source of income for them. Apart from this, USA wanted them to stop their practise of colonisation (it was a condition for the US to include them along with the ‘friendly nations’ during the world war.
So all in all, they wanted to walk out of India- now if they go just like that, it’d be widely understood that they left India in face of the violent protests of the freedom fighters at that time- and that would mean loss of face for the great British Empire. They had to make their departure look amicable- something that would create a feeling of respect for both parties involved- and so that India doesn’t see them as enemies in future. They worked this plan up with the Indian National Congress (it was originally established by an Englishman) and included influential, wealthy Indians including the Nehru clan in it. It was these fore-runners including Gopal Krishna Gokhle that spotted this guy who was protesting in South Africa in novel way, and they brought him across and made him into a hero.
Just the fact that Gandhi’s first visit to India on invitation by the Congress was highly recorded and broadcast, and eventually all his speeches, etc were readily available to the public at that time even when he was in Jail he was addressing the nation constantly. How could this be possible if the Britishers didn’t ‘like’ him? If Indian Government of the present day can shut up activists and make Anna’s and Ramdev’s movements look like a farcical joke, wonder how strongly the British could have suppressed Gandhi in those days without electronic media, internet etc? But they didn’t. They let Gandhi be famous and influential, and made that the reason for their departure.
On their way out they played the masterstroke with bringing up Jinnah and Pakistan- and now India and Pakistan both have each other as enemies, but they both see England as a friendly nation!