Here's my theory
Vanitas is made as a copy of MX but is a in the cross roads of light and darkness. MX gives him the mask to conceal his identity. Since he's a copy he's given a keyblade and goes on to become a keyblade master. As the game progreses he sees that Ven is getting closer to terra...