I'm not sure if it had anything to do with Kuramas hatred because the menma in this world had parents and friends who loved him that's the part I really don't get plus at the end of the movie Menma turns back to normal with blonde hair and everything and I guess he good again.
From what I gathered, when Tobi created the Genjustsu World and shoved both Naruto and Sakura in, something had to come OUT in compensate as the two of them wind up taking the place of their genjustsu selves. The genjustsu Sakura was dumped out into the real world in a nearby forest and became the subject of Shippuden 271 ("Road to Sakura"). Menma, meanwhile, got nabbed by Tobi, corrupted by his influence (gaining the hatred normal people would get in living Naruto's life AND full mastery of Kurama), and shoved back into his own world to act as Tobi's proxy for their plan to kill Naruto and extract the real Kurama. Once Tobi was beaten within the Genjustu World, his influence was taken from Menma for good.