What is the purpose of the infinite tsukuyomi, is it to make everyone dream in their ideal world? Then why does it turn people to white zetsu and steal their chakra?
The infinite tsukuyomi was actually a ruse by Kaguya, executed by black Zetsu, who manipulated Madara.
Kaguya, the origin of all chakra after eating the shinju fruit, became power hungry and was subsequently sealed up by her sons, who then went to distribute/teach the usage of chakra to the rest of mankind. However, through black Zetsu, she was able to manipulate mankind (namely Madara) into recreating the infinite tsukiyomi with the Eye of the Moon plan. In doing so she then would be able hypnotize everyone and reabsorb all of the chakra in the world which she deems "rightfully hers."
The jutsu makes little sense, in my opinion. Madara said he would use the moon to project his tsukuyomi on anyone who looks up at it. Yet, instead, the jutsu summoned a plant that trapped people within it. It ends up using an illusionary world to keep people from struggling as their chakra, and life, is stolen.