Not sure if it is acceptable to ask this here, but I have the opposite question. Why really did Britain let go of India in 1947? Even as an Indian, I really don't know. Our textbooks talk about how Clement Atlee declared that is was going to happen, and Lord Mountbatten was sent here to oversee it. But there is no mention of the driving forces. And it is no use reading our own version of history, since we here suspect a good part of it is manufactured to fit a certain narrative that suited certain people.
/u/Imperial_Affectation summarises a lot of important points. There are some specifics that make India a special case, however. It must be remembered that India was the jewel in the British Empire's crown, it was pre-eminent amongst the colonies; the 'white dominions' might have had more independence, and indeed gained their independence with much greater ease, but their strategic, economic, and, perhaps most importantly, their figurative importance was certainly less than India's. No other British possession was a viceroyalty; in all other places we had governors general or similar. India was a sub-kingdom of the United Kingdom, with the Viceroy at its head, and the Indian princes were his feudal lords. The British worked very hard to maintain the trappings of a feudal system, as it elevated those Indians complicit in its continuation in status, thus encouraging their support.
As a pseudo-kingdom in its own right, it managed its own tax affairs, paid for its own tax collection infrastructure, and paid for its own army. This is an enormous cost saved by the British Crown, and it was put to practical use many times - not just, as most famously, in the First World War, where Indian soldiers were deployed across the world, but throughout the 19th Century for skirmishes with other powers who sought to test their loyalty to Britain. The Japanese during WW2 were in no position to mount an assault on British India. India was an enormous body of land, protected by its own well stocked armies, and was an unwavering foothold of political power in the middle of Britain's greatest trading interests in Asia and Africa.
It must also be remembered that Indian independence was not a foregone conclusion before WW2. We can see that in the British mindset this was so by the numbers of applicants taking the exams to enter the Indian Civil Service, which did not waver. India was the great project of British imperialism. Perhaps in some sense many members of the ICS thought eventually Indians would take up the work of their own governance - indeed, there were Indian members of the ICS, though mostly at sub-secretarial tiers - but in practice, the British institutionally thought of their project as not even being half-complete. No where was British governance taken so seriously, with the country's best young university graduates shipping themselves halfway around the globe to serve. These young gentlemen would not have done this if they thought their tenure was about to end. Other great investments, like Malaya or the Caribbean colonies, all had their own value, but received nothing like the attention from parliament or subsidiary institutions that India did.
All of this is to say that "Britain not wanting" to "give up" India is a much more fundamental question than weighing up accounts sheets; it's a question about British self-perception and how the British imagined themselves in the world. In many ways, the British Empire could not be conceived of without India at its epicentre. WW2 changed the fabric of British society in manifold ways, of which Indian independence is but one aspect.